Defining global variables

Posted on

Ansible allows you to define variables on a per-host and per-group basis.

Because ansible has the special all group that all hosts are automatically a part of, you can create an <INVENTORY_FILE_LOCATION>/group_vars/all file and populate it with variables. These variables will be accessible in all of your plays.

This saves you the trouble of explicitly defining a vars_files entry to include the global variable file in all of your plays.

Leave a Reply

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