Last Updated: February 25, 2016
· kevinsimper

Run ansible on a single host

If you like me are just trying out ansible and do not want to make a inventory file, because you are just trying it against a single host, but you keep seeing this annoying message:

ERROR: Unable to find an inventory file, specify one with -i ?

You have likely ended up with making a inventory file, but you can actually run ansible against a single host.

Running only on a single host

ansible-playbook webserver.yml -i,

Noticed the following comma? That is because if ansible notices a comma, it thinks it is a list of hosts, but you are actually only defining one.

Annoying but reality.