Skip to content

ansible-collections/azure

Ansible collection for Azure

Doc Code of conduct License

Description

This collection provides a series of Ansible modules and plugins for interacting with the Azure.

Documentation of individual modules is available at the Ansible Galaxy

Requirements

  • Python version >= 3.10
  • Ansible version >= 2.16

Installation

Before using this collection, you need to install it with the Ansible Galaxy command-line tool:

ansible-galaxy collection install azure.azcollection

You can also include it in a requirements.yml file and install it with ansible-galaxy collection install -r requirements.yml, using the format:

collections:
  - name: azure.azcollection

To upgrade the collection to the latest available version, run the following command:

ansible-galaxy collection install azure.azcollection --upgrade

You can also install a specific version of the collection. Use the following syntax to install version 1.0.0:

ansible-galaxy collection install azure.azcollection==1.0.0

See using Ansible collections for more details.


After the collection is installed, please install the dependencies required by the collection (adjust path to collection if necessary):

pip install -r ~/.ansible/collections/ansible_collections/azure/azcollection/requirements.txt

Use Cases

Playbook

To use a module from Azure collection, please reference the full namespace, collection name, and modules name that you want to use:

---
- name: Using Azure collection
  hosts: localhost
  tasks:
    - azure.azcollection.azure_rm_storageaccount:
        resource_group: myResourceGroup
        name: mystorageaccount
        account_type: Standard_LRS

Or you can add full namespace and collection name in the collections element:

---
- name: Using Azure collection
  hosts: localhost
  collections:
    - azure.azcollection
  tasks:
    - azure_rm_storageaccount:
        resource_group: myResourceGroup
        name: mystorageaccount
        account_type: Standard_LRS

Role

For existing Ansible roles, please also reference the full namespace, collection name, and modules name which used in tasks instead of just modules name.

Plugin

To use a plugin from Azure collection, please reference the full namespace, collection name, and plugins name that you want to use:

---
plugin: azure.azcollection.azure_rm
include_vm_resource_groups:
  - ansible-inventory-test-rg
auth_source: auto

Testing

Test cases can be found under folder tests.

Contributing

There are many ways in which you can participate in the project, for example:

  • Submit bugs and feature requests, and help us verify as they are checked in
  • Review source code changes
  • Review the documentation and make pull requests for anything from typos to new content
  • If you are interested in fixing issues and contributing directly to the code base, please see the CONTRIBUTING document

Support

  • Join the Ansible forum:
    • Get Help: get help or help others. Please use appropriate tags, for example cloud.
    • Social Spaces: gather and interact with fellow enthusiasts.
    • News & Announcements: track project-wide announcements including social events.
  • The Ansible Bullhorn newsletter: used to announce releases and important changes.

For more information about communication, see the Ansible communication guide.

Release Notes and Roadmap

See the Changelog

Related Information

License Information

GNU General Public License v3.0

See LICENSE to see the full text.