Hi,--I'm trying to get the simplest Dynamic Inventory to work, but it doesn't work because Ansible interprets it as .ini :$ ansible-playbook -i hosts.py play.ymlERROR: Invalid ini entry: sys - need more than 1 value to unpackHere is the code in host.py:import sysif len(sys.argv) == 2 and (sys.argv[1] == '--list'):print """{'local': ['127.0.0.1'],}"""elif len(sys.argv) == 3 and (sys.argv[1] == '--host'):print '{}'else:print "Usage: %s --list or --host <hostname>" % sys.argv[0]sys.exit(1)I can run it and I am pretty sure that it returns what it should, as presented in the documentation, and according to the example there.For the playbook, I'm also using the simplest possible. Here is play.yml:- hosts: allconnection: localtasks:- name: Can I run this playbook?debug: msg="Yes!"It runs properly when I don't use the host.py file:$ ansible-playbook -i 127.0.0.1, play.yml[ output not copied here - it's all fine ! ](note the comma, which enables to run a playbook by directly indicating a host's address, as per here.I'm stuck there.Any idea what I'm doing wrong?
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/852a9e3f-afdc-46af-839b-361699422e23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.