- 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.
- Hands-On Deep Learning with Apache Spark
- 高性能混合信號ARM:ADuC7xxx原理與應用開發
- 條碼技術及應用
- 工業機器人操作與編程
- 網絡化分布式系統預測控制
- Mastering Geospatial Analysis with Python
- Learning Apache Apex
- 空間機器人
- Embedded Linux Development using Yocto Projects(Second Edition)
- 中老年人學電腦與上網
- 運動控制系統
- Learning Couchbase
- Cisco UCS Cookbook
- 實戰大數據(Hadoop+Spark+Flink):從平臺構建到交互式數據分析(離線/實時)
- 電機與電力拖動