NOTE: The issue described in this post was fixed!!! (ansible 2.5.2 and Azure CLI 2.0.34)#
Last week I tried to run this simple Ansible playbook in Azure Cloud Shell:
# resource_group.yml
# Create test resource group in west europe
- name: Create a Resource Group
hosts: localhost
connection: local
gather_facts: no
tasks:
- name: Create Resource Group
azure_rm_resourcegroup:
location: westeurope
name: test
state: presentThe first attempt to run the playbook with:
ansible-playbook resource_group.yml -vvvfailed with the following message: No module named ‘packaging’
So I ran:
pip install --user packagingBut this time when I tried to run the playbook I got a message telling me to upgrade the Azure module for Ansible. Again the first attempt didn’t go well so I forced the upgrade:
pip install ansible[azure] --upgrade --force --userProblem solved!!! Runing the following command did create the resource group:
ansible-playbook resource_group.yml -vvvHope it helps!
