Using a dynamic inventory for Azure infrastructure

When configuring an infrastructure that is composed of several VMs, along with ephemeral environments that are built on demand, the observation often made is that maintaining a static inventory, as we saw in the Creating an inventory for targeting Ansible hosts section, can quickly become complicated and its maintenance takes a lot of time.

To overcome this problem, Ansible allows inventories to be obtained dynamically by calling a script (for example, in Python) that is either provided by cloud providers or a script that we can develop and that aims to return the contents of the inventory.

In this section, we will see the different steps to use Ansible to configure VMs in Azure using a dynamic ...

Get Learning DevOps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.