With the release of Ansible 2.9, Microsoft furthers its commitment to ensure that Azure provides excellent experiences for Ansible users when automating the provisioning and configuration of Azure resources.

To provide great end-to-end experiences for all users, we’re announcing the expansion of Azure service coverage and the ability to release more frequent updates to Ansible users, alongside improved capacities to support your work with virtual machines (VMs), virtual machine scale sets (VMSS), and info modules. Additionally, the Ansible 2.9 release includes 28 new Azure modules.

Enhanced support for Azure virtual machine and virtual machine scale sets

As we continue to enhance support for VMs and VMSS based on community feedback, we’ve added native support for the Azure Shared Image Gallery (SIG) so you can deploy custom images in the SIG directly to VMs and VMSS. This major step enables your teams to replicate images across organizations and subscriptions, ultimately leading to optimized sharing of golden images. Please follow this step-by-step tutorial to create a generalized image that can be shared across subscriptions and active directory tenants in your organization.

Please leverage the following modules:

The Azure collection

Due to customer feedback from AnsibleFest, we have taken measures to move the 18 certified Azure modules to an Azure collection called azcollection. As on of the early adopters of collections, we’re particularly excited that Ansible’s new content distribution format enables Azure to provide more timely, comprehensive, and frequent updates to support our users.

To use modules from azcollection,

1. Install the collection hosted in Galaxy:
ansible-galaxy collection install azure.azcollection

2. Use the collections keyword in your playbooks:

- hosts: all
  collections:
   - azure.azcollection
  tasks:
    - azure_rm_virtualmachine:
       resource_group: myResourceGroup
       …

Please refer to the Using collections page for more information.

Renaming facts modules to info

We’ve renamed all facts modules to info in order to adhere to Ansible’s naming conventions. You do not need to update existing playbooks that are using azure_rm_*_facts. We have implemented links to point to the new modules. If you are working on a new playbook, we highly recommend that you use the new module names instead of the old module names for the sake of consistency, and as a best practice moving forward.

New modules

On top of the modules mentioned above, here are the new modules that allow users to configure even more automation on Azure:

For a full list of what’s supported, refer to the Ansible module and version matrix on the Ansible Documentation Hub.

Please be on the lookout for additional features and tutorials to be added to these new modules.

Questions, comments, or feedback? Please let us know in the comments below.

Additional resources

Ansible Documentation Hub

Azure Shared Image Gallery

Azure Shared Image Gallery using Ansible step-by-step tutorial

Using collections