Home - nsg/ansible-inventory GitHub Wiki

All you need is inventory.py from this repository. I recommend that you check it in with your inventory files to keep things simple. The script will try to open a file called inventory.yml from the same path where inventory.py is.

A simple test yaml-inventory looks like this:

$ cat inventory.yml
---

groups:
  - myhost01.example.com

Run Ansible:

$ ansible -i inventory.py --list-hosts -m setup all
    myhost01.example.com

For more information see the [sub pages](Tags and Groups) a [real world example](Real World Example).