2018-03-14 20:44:21 +01:00
.. _intro_configuration:
2018-02-13 16:23:55 +01:00
***** ***** ***** *** *
Configuring Ansible
***** ***** ***** *** *
2013-09-29 21:51:26 +02:00
2013-12-26 20:32:01 +01:00
.. contents :: Topics
2013-09-29 21:51:26 +02:00
2017-09-26 00:37:33 +02:00
This topic describes how to control Ansible settings.
2014-02-14 21:34:58 +01:00
2017-09-23 05:19:50 +02:00
.. _the_configuration_file:
2013-09-29 21:51:26 +02:00
2017-09-23 05:19:50 +02:00
Configuration file
2018-02-13 16:23:55 +01:00
==================
2016-09-16 21:44:22 +02:00
2017-09-23 05:19:50 +02:00
Certain settings in Ansible are adjustable via a configuration file (ansible.cfg).
The stock configuration should be sufficient for most users, but there may be reasons you would want to change them.
2018-05-25 06:29:29 +02:00
Paths where configuration file is searched are listed in :ref: `reference documentation<ansible_configuration_settings_locations>` .
2016-09-16 21:44:22 +02:00
2013-10-05 00:14:54 +02:00
.. _getting_the_latest_configuration:
2013-09-29 21:51:26 +02:00
Getting the latest configuration
2018-06-30 01:46:10 +02:00
--------------------------------
2013-09-29 21:51:26 +02:00
2019-01-02 19:28:35 +01:00
If installing Ansible from a package manager, the latest `` ansible.cfg `` file should be present in `` /etc/ansible `` , possibly
as a `` .rpmnew `` file (or other) as appropriate in the case of updates.
2013-09-29 21:51:26 +02:00
2017-09-26 00:37:33 +02:00
If you installed Ansible from pip or from source, you may want to create this file in order to override
2013-09-29 21:51:26 +02:00
default settings in Ansible.
2019-01-15 14:53:04 +01:00
An `example file is available on GitHub <https://raw.githubusercontent.com/ansible/ansible/devel/examples/ansible.cfg> `_ .
2013-10-08 14:26:40 +02:00
2018-04-25 20:18:52 +02:00
For more details and a full listing of available configurations go to :ref: `configuration_settings<ansible_configuration_settings>` . Starting with Ansible version 2.4, you can use the :ref: `ansible-config` command line utility to list your available options and inspect the current values.
2013-09-29 21:51:26 +02:00
2018-04-18 03:45:07 +02:00
For in-depth details, see :ref: `ansible_configuration_settings` .
2013-10-05 00:14:54 +02:00
2018-06-30 01:46:10 +02:00
.. _environmental_configuration:
2013-09-29 21:51:26 +02:00
2017-09-23 05:19:50 +02:00
Environmental configuration
2018-02-13 16:23:55 +01:00
===========================
2017-01-05 22:38:36 +01:00
2017-09-26 00:37:33 +02:00
Ansible also allows configuration of settings using environment variables.
2017-09-23 05:19:50 +02:00
If these environment variables are set, they will override any setting loaded from the configuration file.
2017-01-05 22:38:36 +01:00
2018-04-18 03:45:07 +02:00
You can get a full listing of available environment variables from :ref: `ansible_configuration_settings` .
2017-01-05 22:38:36 +01:00
2017-09-23 05:19:50 +02:00
.. _command_line_configuration:
2015-12-10 05:25:23 +01:00
2017-09-23 05:19:50 +02:00
Command line options
2018-02-13 16:23:55 +01:00
====================
2015-12-10 05:25:23 +01:00
2017-09-23 05:19:50 +02:00
Not all configuration options are present in the command line, just the ones deemed most useful or common.
Settings in the command line will override those passed through the configuration file and the environment.
2015-12-10 05:25:23 +01:00
2018-02-13 16:23:55 +01:00
The full list of options available is in :ref: `ansible-playbook` and :ref: `ansible` .