How it works...
In step 1, we created a virtual network with the name vnet01 within the same resource group we used in the first recipe, Creating an Azure virtual machine. Since we are using a resource group, the resources can pick the default location of the resource group. We have defined the CIDR network addresses as 10.2.0.0/24 and 172.1.0.0/16. We can also define multiple network addresses using YAML syntax.
We should note here that if we want to delete an existing virtual network, we can set the state to absent. By default, most of the Ansible modules have their state set to present.
In step 2, we created a subnet using the azure_rm_subnet module inside the virtual network vnet01.
In step 3, we created a network interface card using ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access