Building an Ansible inventory
Again, as in the AWS chapter, you have to describe the network services to deploy in the Azure cloud. In this recipe, we’ll create another host inventory file in Ansible, declaring the virtual networks as nodes in the inventory, an equivalent of the AWS VPCs. You will still notice that the virtual network doesn’t have a management IP address, so the ansible_host argument is not needed.
In the inventory file, we organize the network into the following groups:
us_az_net: Grouping the virtual networks in the United Stateseu_az_net: Grouping the virtual networks in Europeaz_net: Grouping both virtual networks
Note
Similarly to Chapter 8, we’ll use a static inventory file. But there is an Azure dynamic inventory plugin to pull existing Azure resources dynamically:
https://docs.ansible.com/ansible/latest/collections/azure/azcollection/azure_rm_inventory.html
In this chapter...