mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #14428 from shawnsilva/linode-invscript-addips
Linode Dynamic Inventory: Add public IP's as hostvars
This commit is contained in:
commit
1b3c669ebe
1 changed files with 5 additions and 0 deletions
|
@ -280,6 +280,11 @@ class LinodeInventory(object):
|
|||
node_vars["datacenter_city"] = self.get_datacenter_city(node)
|
||||
node_vars["public_ip"] = [addr.address for addr in node.ipaddresses if addr.is_public][0]
|
||||
|
||||
# Set the SSH host information, so these inventory items can be used if
|
||||
# their labels aren't FQDNs
|
||||
node_vars['ansible_ssh_host'] = node_vars["public_ip"]
|
||||
node_vars['ansible_host'] = node_vars["public_ip"]
|
||||
|
||||
private_ips = [addr.address for addr in node.ipaddresses if not addr.is_public]
|
||||
|
||||
if private_ips:
|
||||
|
|
Loading…
Reference in a new issue