官术网_书友最值得收藏!

  • Learning DevOps
  • Mikael Krief
  • 227字
  • 2021-06-24 12:32:11

Configuring Ansible

By default, the Ansible configuration is in the /etc/ansible/ansible.cfg file that is created during the installation of Ansible. This file contains several configuration keys, such as an SSL connection, a user, a protocol, transport, and many others.

This file is created by default during the installation of Ansible and, to guide the user to get started, initial content is placed in it. This content contains a multitude of configuration keys that are commented out so that they are not applied by Ansible but can be activated at any time by the user.

The following screenshot shows an extract from this /etc/ansible/ansible.cfg configuration file with some keys in comment with the # symbol:

If we want to change the default Ansible configuration, we can modify this file.

For more details about all Ansible configuration keys, see the official documentation:  https://docs.ansible.com/ansible/latest/reference_appendices/config.html#ansible-configuration-settings.

We can also view and modify this configuration using the ansible-config command. For example, for displaying the Ansible configuration file, execute the following command:

ansible-config view

The following screenshot shows the execution of this command:

In this section, we have seen how to install Ansible and then we have explored some of Ansible's artifacts. Finally, we saw different ways to configure Ansible.

In the next section, we will detail a static Ansible inventory and how to create it for targeting hosts.

主站蜘蛛池模板: 孙吴县| 竹北市| 临城县| 攀枝花市| 凤翔县| 塘沽区| 肇庆市| 吉木乃县| 龙海市| 玉门市| 昌平区| 克什克腾旗| 舟山市| 台湾省| 嘉义市| 泰安市| 宿松县| 赤城县| 西乡县| 咸宁市| 丹阳市| 洛浦县| 高邮市| 嘉兴市| 乌拉特中旗| 五河县| 阿巴嘎旗| 稷山县| 嫩江县| 闸北区| 罗平县| 申扎县| 汉沽区| 石嘴山市| 攀枝花市| 株洲市| 鱼台县| 潍坊市| 古田县| 都兰县| 应用必备|