- 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
- 計算機應用
- AutoCAD繪圖實用速查通典
- Design for the Future
- 嵌入式系統應用
- 基于LPC3250的嵌入式Linux系統開發
- Julia 1.0 Programming
- 條碼技術及應用
- 數據產品經理:解決方案與案例分析
- SharePoint 2010開發最佳實踐
- Embedded Programming with Modern C++ Cookbook
- 傳感器與物聯網技術
- 人工智能趣味入門:光環板程序設計
- Statistics for Data Science
- Mastering Machine Learning with R