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

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

Creating an inventory for targeting Ansible hosts

The inventory contains the list of hosts on which Ansible will perform administration and configuration actions.

There are two types of inventories:

  • Static inventory: Hosts are listed in a text file in INI (or YAML) format; this is the basic mode of Ansible inventory. The static inventory is used in cases where we know the host addresses (IP or FQDN).
  • Dynamic inventory: The list of hosts is dynamically generated by an external script (for example, with a Python script). The dynamic inventory is used in case we do not have the addresses of the hosts, for example, as with an infrastructure that is composed of on-demand environments.

In this section, we will see how to create a static inventory in init format, starting with a basic example, and then we will look at the groups and host configuration.

Let's start by seeing how to create a static inventory file.

主站蜘蛛池模板: 克山县| 祁阳县| 册亨县| 娄烦县| 巴林左旗| 鄯善县| 中卫市| 巴南区| 呈贡县| 荃湾区| 合阳县| 嘉义市| 弋阳县| 霍邱县| 利津县| 辉南县| 肇源县| 平乡县| 合作市| 宝应县| 普定县| 札达县| 兴安县| 芜湖市| 密云县| 延长县| 农安县| 韶关市| 偏关县| 石门县| 古浪县| 白山市| 沾化县| 苗栗县| 江源县| 兖州市| 丹寨县| 丘北县| 德令哈市| 宁阳县| 米易县|