From 3b12a85750707cbbb6ebef87df75f9ab1e371fd2 Mon Sep 17 00:00:00 2001 From: Do Hoang Khiem Date: Thu, 10 Aug 2017 01:45:00 +0700 Subject: [PATCH] Add node private & public ips to gce groups (#12539) --- contrib/inventory/gce.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/inventory/gce.py b/contrib/inventory/gce.py index 076e69c5ada..a73c8b7d023 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