diff options
author | Do Hoang Khiem <dohoangkhiem@gmail.com> | 2017-08-10 01:45:00 +0700 |
---|---|---|
committer | Chris Alfonso <christopher.alfonso@gmail.com> | 2017-08-09 12:45:00 -0600 |
commit | 3b12a85750707cbbb6ebef87df75f9ab1e371fd2 (patch) | |
tree | 350a8dcf4b8c1582d1c284d437353fe059806184 /contrib | |
parent | 756b5104142feac1ace9f4670a91fe1841f879ec (diff) | |
download | ansible-3b12a85750707cbbb6ebef87df75f9ab1e371fd2.tar.gz |
Add node private & public ips to gce groups (#12539)
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/inventory/gce.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/inventory/gce.py b/contrib/inventory/gce.py index 076e69c5ad..a73c8b7d02 100755 --- a/contrib/inventory/gce.py +++ b/contrib/inventory/gce.py @@ -477,6 +477,13 @@ class GceInventory(object): else: groups[stat] = [name] + for private_ip in node.private_ips: + groups[private_ip] = [name] + + if len(node.public_ips) >= 1: + for public_ip in node.public_ips: + groups[public_ip] = [name] + groups["_meta"] = meta return groups |