Chnage from deprecated variable
This commit is contained in:
parent
79f6cd774a
commit
bf477c24d3
1 changed files with 6 additions and 6 deletions
|
@ -212,7 +212,7 @@ def metal_device(resource, tfvars=None):
|
||||||
'project_id': raw_attrs['project_id'],
|
'project_id': raw_attrs['project_id'],
|
||||||
'state': raw_attrs['state'],
|
'state': raw_attrs['state'],
|
||||||
# ansible
|
# ansible
|
||||||
'ansible_ssh_host': raw_attrs['network.0.address'],
|
'ansible_host': raw_attrs['network.0.address'],
|
||||||
'ansible_ssh_user': 'root', # Use root by default in metal
|
'ansible_ssh_user': 'root', # Use root by default in metal
|
||||||
# generic
|
# generic
|
||||||
'ipv4_address': raw_attrs['network.0.address'],
|
'ipv4_address': raw_attrs['network.0.address'],
|
||||||
|
@ -292,16 +292,16 @@ def openstack_host(resource, module_name):
|
||||||
try:
|
try:
|
||||||
if 'metadata.prefer_ipv6' in raw_attrs and raw_attrs['metadata.prefer_ipv6'] == "1":
|
if 'metadata.prefer_ipv6' in raw_attrs and raw_attrs['metadata.prefer_ipv6'] == "1":
|
||||||
attrs.update({
|
attrs.update({
|
||||||
'ansible_ssh_host': re.sub("[\[\]]", "", raw_attrs['access_ip_v6']),
|
'ansible_host': re.sub("[\[\]]", "", raw_attrs['access_ip_v6']),
|
||||||
'publicly_routable': True,
|
'publicly_routable': True,
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
attrs.update({
|
attrs.update({
|
||||||
'ansible_ssh_host': raw_attrs['access_ip_v4'],
|
'ansible_host': raw_attrs['access_ip_v4'],
|
||||||
'publicly_routable': True,
|
'publicly_routable': True,
|
||||||
})
|
})
|
||||||
except (KeyError, ValueError):
|
except (KeyError, ValueError):
|
||||||
attrs.update({'ansible_ssh_host': '', 'publicly_routable': False})
|
attrs.update({'ansible_host': '', 'publicly_routable': False})
|
||||||
|
|
||||||
# Handling of floating IPs has changed: https://github.com/terraform-providers/terraform-provider-openstack/blob/master/CHANGELOG.md#010-june-21-2017
|
# Handling of floating IPs has changed: https://github.com/terraform-providers/terraform-provider-openstack/blob/master/CHANGELOG.md#010-june-21-2017
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ def iter_host_ips(hosts, ips):
|
||||||
'access_ip_v4': ip,
|
'access_ip_v4': ip,
|
||||||
'access_ip': ip,
|
'access_ip': ip,
|
||||||
'public_ipv4': ip,
|
'public_ipv4': ip,
|
||||||
'ansible_ssh_host': ip,
|
'ansible_host': ip,
|
||||||
})
|
})
|
||||||
|
|
||||||
if 'use_access_ip' in host[1]['metadata'] and host[1]['metadata']['use_access_ip'] == "0":
|
if 'use_access_ip' in host[1]['metadata'] and host[1]['metadata']['use_access_ip'] == "0":
|
||||||
|
@ -389,7 +389,7 @@ def query_list(hosts):
|
||||||
def query_hostfile(hosts):
|
def query_hostfile(hosts):
|
||||||
out = ['## begin hosts generated by terraform.py ##']
|
out = ['## begin hosts generated by terraform.py ##']
|
||||||
out.extend(
|
out.extend(
|
||||||
'{}\t{}'.format(attrs['ansible_ssh_host'].ljust(16), name)
|
'{}\t{}'.format(attrs['ansible_host'].ljust(16), name)
|
||||||
for name, attrs, _ in hosts
|
for name, attrs, _ in hosts
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue