Running Terraform and Ansible in Azure Pipelines
After the creation of the Packer pipeline, we will now create the pipeline for provisioning an Azure VM that uses the image created with Packer and then configures this VM with Ansible. For this demonstration, we will use Ansible to install nginx on this VM.
The Terraform configuration that is used in this code will provision new Azure resource group, a virtual network with a subnet, and a Linux VM with the tag role as the webserver
value.
This complete Terraform code is available here: https://github.com/PacktPublishing/Learning-DevOps-Second-Edition/tree/main/CHAP08/terraform. I will not explain it, since it's the same code that we learned in Chapter 2, Provisioning Cloud Infrastructure with Terraform.
The complete Ansible code that we used to install nginx on the Linux machine is available here: https://github.com/PacktPublishing/Learning-DevOps-Second-Edition/blob/main/CHAP08/ansible/playbookdemo.yml. We already learned...