Ansible 2.9: Azure shared image galleries, Azure collection, and new modules – Open Source Blog

Microsoft Cloud Blog | Nov 7, 2019 at 8:00 PM

With the release of Ansible 2.9, Microsoft furthers its commitment to ensuring that Azure provides excellent experiences for Ansible users when automating, provisioning, and configuring 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 automatically push 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:

* azure_rm_gallery

* azure_rm_gallery_info

* azure_rm_galleryimage

* azure_rm_galleryimage_info

* azure_rm_galleryimageversion

* azure_rm_galleryimageversion_info

* azure_rm_snapshot

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 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 directly.

To use modules from azcollection,

1. Install the collection hosted in Galaxy:

2. Use the collections keyword in your playbooks:

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. To prevent customers from needing 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 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:

* azure_rm_automationaccount

* azure_rm_automationaccount_info

* azure_rm_azurefirewall

* azure_rm_azurefirewall_info

* azure_rm_batchaccount

* azure_rm_devtestlabcustomimage_info

* azure_rm_devtestlabenvironment_info

* azure_rm_devtestlabpolicy_info

* azure_rm_devtestlabschedule_info

* azure_rm_hdinsightcluster_info

* azure_rm_iotdevice

* azure_rm_iotdevice_info

* azure_rm_iotdevicemodule

* azure_rm_iothub

* azure_rm_iothub_info

* azure_rm_iothubconsumergroup

* azure_rm_lock

* azure_rm_lock_info

* azure_rm_monitorlogprofile

* azure_rm_securitygroup_info

* azure_rm_virtualnetworkpeering_info

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.