In the previous chapters, we have specified the hosts in the command line. This worked well while having a single host to work on, but it will not work very well when managing multiple servers. In this chapter, we will see exactly how to leverage inventories to manage multiple servers. Also, we will introduce topics such as host variables and group variables to make it possible to easily and quickly set up similar but different hosts. We will speak about loops in Ansible, which allows you to reduce the amount of code you write and at the same time make it more readable as well.
In this chapter, we will be covering the following topics:
- Working with inventory files
- Working with variables