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

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.

主站蜘蛛池模板: 长顺县| 泸西县| 海林市| 南通市| 娱乐| 安新县| 皋兰县| 高唐县| 宜兴市| 永靖县| 济源市| 庆元县| 密云县| 桑日县| 池州市| 景泰县| 大方县| 潞城市| 富阳市| 镇坪县| 佳木斯市| 黑河市| 万载县| 子长县| 富裕县| 乐安县| 文登市| 林芝县| 武威市| 庆元县| 赤城县| 金门县| 香港| 海晏县| 敦化市| 康乐县| 萝北县| 即墨市| 尚志市| 庆城县| 德保县|