- Ansible 2 Cloud Automation Cookbook
- Aditya Patawari Vikas Aggarwal
- 200字
- 2021-06-24 18:43:36
Using dynamic inventory
We have talked about dynamic inventory a little bit in this chapter. Throughout this book, in every chapter, we are going to talk about and use dynamic inventory. So let us explore the concept in a bit more depth.
Reiterating what we wrote earlier, dynamic inventory is useful for infrastructures that are dynamic in nature or for cases where we do not want to or cannot maintain a static inventory. Dynamic inventory queries a datasource and builds the inventory in real time. For the sake of this book, we will query cloud providers to get data and build the inventory. Ansible provides dynamic inventory scripts for most of the popular cloud providers.
However, it is simple to create a dynamic inventory script by ourselves. Any executable script that can return a JSON with a list of inventory host groups and hosts in a predetermined format, when passed with a parameter --list can be used as an inventory script. A very simple inventory would output something like this:
{
"application": ["10.0.0.11", "10.0.0.12"],
"database": ["10.0.1.11"]
}
More elaborate inventory scripts would output much more information like instance tags, names, operating systems, geographical locations, and, also known as host facts.
- 后稀缺:自動(dòng)化與未來工作
- Oracle SOA Governance 11g Implementation
- Creo Parametric 1.0中文版從入門到精通
- iClone 4.31 3D Animation Beginner's Guide
- CompTIA Network+ Certification Guide
- Windows環(huán)境下32位匯編語言程序設(shè)計(jì)
- 21天學(xué)通C語言
- 單片機(jī)C語言應(yīng)用100例
- Mastering Game Development with Unreal Engine 4(Second Edition)
- 軟件工程及實(shí)踐
- 網(wǎng)絡(luò)服務(wù)器搭建與管理
- 大數(shù)據(jù):引爆新的價(jià)值點(diǎn)
- Java求職寶典
- Practical Network Automation
- 軟件測(cè)試管理