docs: def update_hacluster_vip(service, relation_data):
      """ Configure VIP resources based on provided configuration
  
      @param service: Name of the service being configured
      @param relation_data: Pointer to dictionary of relation data.
      """
      cluster_config = get_hacluster_config()
      vip_group = []
      vips_to_delete = []
      for vip in cluster_config['vip'].split():
          if is_ipv6(vip):
              res_vip = 'ocf:heartbeat:IPv6addr'
              vip_params = 'ipv6addr'
          else:
              res_vip = 'ocf:heartbeat:IPaddr2'
              vip_params = 'ip'
  
          iface, netmask, fallback = get_vip_settings(vip)
  
          vip_monitoring = 'op monitor depth="0" timeout="20s" interval="10s"'
          if iface is not None:
              # NOTE(jamespage): Delete old VIP resources
              # Old style naming encoding iface in name
              # does not work well in environments where
              # interface/subnet wiring is not consistent
              vip_key = 'res_{}_{}_vip'.format(service, iface)
              if vip_key in vips_to_delete:
                  vip_key = '{}_{}'.format(vip_key, vip_params)
              vips_to_delete.append(vip_key)
  
              vip_key = 'res_{}_{}_vip'.format(
                  service,
                  hashlib.sha1(vip.encode('UTF-8')).hexdigest()[:7])
  
              relation_data['resources'][vip_key] = res_vip
              # NOTE(jamespage):
              # Use option provided vip params if these where used
              # instead of auto-detected values
              if fallback:
                  relation_data['resource_params'][vip_key] = (
                      'params {ip}="{vip}" cidr_netmask="{netmask}" '
                      'nic="{iface}" {vip_monitoring}'.format(
                          ip=vip_params,
                          vip=vip,
                          iface=iface,
                          netmask=netmask,
                          vip_monitoring=vip_monitoring))
              else:
                  # NOTE(jamespage):
                  # let heartbeat figure out which interface and
                  # netmask to configure, which works nicely
                  # when network interface naming is not
                  # consistent across units.
                  relation_data['resource_params'][vip_key] = (
                      'params {ip}="{vip}" {vip_monitoring}'.format(
                          ip=vip_params,
                          vip=vip,
                          vip_monitoring=vip_monitoring))
  
              vip_group.append(vip_key)
  
      if vips_to_delete:
          try:
              relation_data['delete_resources'].extend(vips_to_delete)
          except KeyError:
              relation_data['delete_resources'] = vips_to_delete
  
      if len(vip_group) >= 1:
          key = VIP_GROUP_NAME.format(service=service)
          try:
              relation_data['groups'][key] = ' '.join(vip_group)
          except KeyError:
              relation_data['groups'] = {
                  key: ' '.join(vip_group)
              }