IndexError: list index out of range for GCE dynamic inventory

32 views
Skip to first unread message

abdulrahim umar

unread,
Jan 14, 2015, 9:15:53 PM1/14/15
to ansible...@googlegroups.com
When running the dynamic inventory script against a gce deployment , some nodes with external ips some without (running connecting through NAT ) i encounter this error when running list:

sh-3.2# ./inventory/gce/gce.py --list
Traceback (most recent call last):
  File "./inventory/gce/gce.py", line 287, in <module>
    GceInventory()
  File "./inventory/gce/gce.py", line 111, in __init__
    print(self.json_format_dict(self.group_instances(),
  File "./inventory/gce/gce.py", line 242, in group_instances
    meta["hostvars"][name] = self.node_to_dict(node)
  File "./inventory/gce/gce.py", line 214, in node_to_dict
    'gce_public_ip': inst.public_ips[0],
IndexError: list index out of range

only happens when there are nodes without external ips.When given temporary external ips the dynamic inventory proceeds as expected.Not sure if a bug in the gce.py script or elsewhere.
Reply all
Reply to author
Forward
0 new messages