Creating an inventory file and adding hosts
Whenever you see a reference to “creating an inventory” in Ansible, you are normally quite safe to assume that it is a static inventory. Ansible supports two types of inventory—static and dynamic—and we will cover the latter of these two later in this chapter. Static inventories are by their very nature static; they are unchanging unless a human manually edits them. This is great when you are starting out and testing Ansible, as it provides you with a very quick and easy way to get up and running quickly. Even in small, closed environments, static inventories are a great way to manage your environment, especially when changes to the infrastructure are infrequent.
Most Ansible installations will look for a default inventory file in /etc/ansible/hosts
(though this path is configurable in the Ansible configuration file, as discussed in Chapter 2, Understanding the Fundamentals of Ansible). You are welcome to populate...