Make it possible to disable access_ip (openstack provider) (#5239)

* Add a variable do disable access_ip

* Document the use of use_access_ip
This commit is contained in:
Hugo Blom
2019-10-07 13:09:09 +02:00
committed by Kubernetes Prow Robot
parent 0ba336b04e
commit a8c5a0afdc
7 changed files with 36 additions and 3 deletions

View File

@ -339,14 +339,19 @@ 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']
use_access_ip = host[1]['metadata']['use_access_ip']
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 == "0":
host[1].pop('access_ip')
yield host