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

Defining Your Inventory

As we have already discussed in the first two chapters, Ansible cannot do anything until you tell it what hosts it is responsible for. This is, of course, logical—you wouldn't want any automation tool, regardless of how easy it is to use and set up, to simply go out and take control of every single device on your network. Hence, at the bare minimum, you must tell Ansible what hosts it is going to automate tasks on, and this, in the most fundamental terms, is what an inventory is.

However, there is so much more to inventories than just a list of automation targets. Ansible inventories can be provided in several formats; they can be either static or dynamic, and they can contain important variables that define how Ansible interacts with each host (or groups of hosts). Hence, they deserve a chapter to themselves, and in this chapter, we shall perform a practical exploration of inventories and how to use them to your best advantage as you automate your infrastructure with Ansible.

In this chapter, we will cover the following topics:

  • Creating an inventory file and adding hosts
  • Generating a dynamic inventory file
  • Special host management using patterns
主站蜘蛛池模板: 盈江县| 富源县| 天峨县| 张掖市| 荣昌县| 慈溪市| 大化| 清远市| 海宁市| 成安县| 东莞市| 玛曲县| 鱼台县| 柳林县| 威海市| 高雄市| 荣成市| 大关县| 灵寿县| 边坝县| 柘城县| 新河县| 东乡县| 府谷县| 望奎县| 金川县| 临武县| 盖州市| 甘南县| 庐江县| 道真| 凌源市| 潮安县| 陈巴尔虎旗| 岚皋县| 芮城县| 永春县| 航空| 伊春市| 绥滨县| 荥阳市|