Integrating Ansible into Azure Cloud Shell
If we have an Azure subscription, we learned in Chapter 2, Provisioning Cloud Infrastructure with Terraform, that Azure Cloud Shell integrates third-party tools that can be used in Azure without having to install them on a VM. Among these tools is Terraform, which we saw in detail in the previous chapter, but there is also Ansible, which Microsoft has integrated to facilitate the automatic configuration of the VMs that are hosted in Azure.
To use Ansible in Azure Cloud, we must do the following:
- Connect to the Azure portal at https://portal.azure.com.
- Open Cloud Shell.
- Choose Bash mode.
- In the Terminal that opens, we now have access to all Ansible commands.
The following screenshot shows the Ansible command in Azure Cloud Shell:
This way, it will be possible to use Ansible for development and testing without installing any software.
Also, Ansible has modules that allow the provisioning of an Azure infrastructure (such as Terraform, but this aspect of Ansible will not be covered in this book), and therefore its integration into Azure Cloud Shell allows a simplified authentication.
Before we start using Ansible, we will review the important concepts (or artifacts) of Ansible, which will serve us throughout this chapter.