Ansible 2.0.0.2 fails on dynamic inventory

72 views
Skip to first unread message

Francois Barriere

unread,
Jan 29, 2016, 8:54:55 AM1/29/16
to Ansible Project
Hi,

   I have a dynamic inventory source (mixed with static files for further grouping), that works with Ansible 1.9.4 but fails with Ansible 2.0
with the error:

Traceback (most recent call last):
  File "/opt/ansible-python/2016-01-26/Linux-x86_64/ansible-2.0.0.2/bin/ansible-playbook", line 85, in <module>
    sys.exit(cli.run())
  File "/opt/ansible-python/2016-01-26/Linux-x86_64/ansible-2.0.0.2/lib/python2.7/site-packages/ansible/cli/playbook.py", line 128, in run
    inventory = Inventory(loader=loader, variable_manager=variable_manager, host_list=self.options.inventory)
  File "/opt/ansible-python/2016-01-26/Linux-x86_64/ansible-2.0.0.2/lib/python2.7/site-packages/ansible/inventory/__init__.py", line 81, in __init__
    self.parse_inventory(host_list)
  File "/opt/ansible-python/2016-01-26/Linux-x86_64/ansible-2.0.0.2/lib/python2.7/site-packages/ansible/inventory/__init__.py", line 124, in parse_inventory
    self.parser = InventoryDirectory(loader=self._loader, groups=self.groups, filename=host_list)
  File "/opt/ansible-python/2016-01-26/Linux-x86_64/ansible-2.0.0.2/lib/python2.7/site-packages/ansible/inventory/dir.py", line 164, in __init__
    host.groups.remove(ungrouped)
ValueError: list.remove(x): x not in list


Is there any dynalic inventory output format documentation (I did not find it)?
Is there  any change in the dynamic inventory JSON format between 1.9 and 2.0?

François.

Brian Coca

unread,
Jan 29, 2016, 9:21:57 AM1/29/16
to Ansible Project
The format has not changed, though validation is now stricter, but in
this case it looks like a bug. Please open an Issue in github and
please use the issue template to provide information enough to
reproduce this.


--
Brian Coca
Reply all
Reply to author
Forward
0 new messages