Ansible without an inventory file

08 Dec 2015 in Infrastructure

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

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