How to run Ansible without specifying the inventory but the host directly?


I want to run Ansible in Python without specifying the inventory file through (ANSIBLE_HOST) but just by:

I can actually do this in fabric easily but just wonder how to do this in Python. On the other hand, documentation of the Ansible API for python is not really complete.


Surprisingly, the trick is to append a ,


The host parameter preceding the , can be either a hostname or an IPv4/v6 address.

Leave a Reply