Ansible without an inventory file

This is a nice little trick. If you’re working with a small number of servers (in my case, it was just one - my desktop), Ansible doesn’t actually require an inventory file. You can specify a comma-separated list of hosts on the command line (there has to be at least one comma, so the trailing comma in this example is important). In this case, I’m also using a local connection instead of SSH

ansible-playbook -c local -i 'localhost,' playbook/to/run.yml

Published:
December 08, 2015

Category
Infrastructure