I installed ansible with pip into my virtualenv, but I didn't find hosts file.
I have one /etc/ansible/hosts
, but this is related to global install of ansible on the system.
The default location for the inventory file is /etc/ansible/hosts. You can also create project-specific inventory files in alternate locations. The inventory file can list individual hosts or user-defined groups of hosts.
Home directory. /etc/ansible/ansible. cfg.
Set up virtualenv¶After you install virtualenv, you can create a “virtual environment” to host your local copy of Ansible. This command creates a directory called myansible in your current working directory. This directory contains a copy of Python that will install modules in the myansible directory.
You can create inventory file anywhere you like.
Just point Ansible to it via -i /path/to/inventory
parameter or setting:
[defaults]
inventory = /path/to/inventory
in your local ansible.cfg
file.
Ansible searches for config file here (in this order):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With