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

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.

主站蜘蛛池模板: 镇坪县| 金溪县| 含山县| 乌审旗| 霍州市| 水富县| 哈密市| 乌拉特后旗| 永胜县| 武宁县| 许昌县| 天津市| 资源县| 阳泉市| 班玛县| 灵石县| 浦北县| 斗六市| 信阳市| 清河县| 定边县| 牟定县| 海晏县| 勃利县| 额尔古纳市| 湖北省| 大同县| 中西区| 阳朔县| 五寨县| 新闻| 自治县| 永泰县| 财经| 沁阳市| 东安县| 顺义区| 三都| 伊春市| 新龙县| 乌鲁木齐县|