INNER CODE UNIT · Python

iter_host_ips

okd-project/okd · Guides/UPI/okd4-terraform-openstack/inventory/terraform.py:345

def iter_host_ips(hosts, ips):
    '''Update hosts that have an entry in the floating IP list'''
    for host in hosts:
        host_id = host[1]['id']

        if host_id in ips:
            ip = ips[host_id]

            host[1].update({
                'access_ip_v4': ip,
                'access_ip': ip,
                'public_ipv4': ip,
                'ansible_ssh_host': ip,
            })

        if 'use_access_ip' in host[1]['metadata'] and host[1]['metadata']['use_access_ip'] == "0":
                host[1].pop('access_ip')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…