How to (where to) Create an Ansible Configure File

Ansible Configuration File

As a default, Ansible expects to find files in a certain place. Some of these files may not suit your needs. To configure ansible to better suit your needs, use the ansible configuration file.

There are at least 2 ways to do this.
You can create a global configuration file by creating it in your home folder like this:

touch ~/.ansible.cfg


inventory = ~/Path/To/ansible/hosts

Or, you can add an Ansible Configuration File to the root of your projects. That way you may have, for example, a hosts file relative to the root of a project.


inventory = hosts

Leave a Reply

Your email address will not be published. Required fields are marked *