I'm running Ansible using AWX, I have configured Azure Credentials and I'm able to use Azure Modules to create/delete Azure Resources.
However Ansible is lacking some of the modules that I need, therefore I wanted to run direct commands using Azure CLI however every time I receive a result that there is no such command.
How Ansible/AWX/Tower is executing commands from Azure Modules?
Running code below against localhost:
hosts: localhost
#
#This part is working
- name: Create a network interface with minimal parameters
azure_rm_networkinterface:
name: "{{ vm_name }}-nic"
resource_group: "{{ internal_name }}-{{ customer_name }}"
virtual_network: "{{ internal_name }}-vnet"
subnet_name: "{{ internal_name }}-subnet01"
security_group: "{{ internal_name }}-subnet01-nsg"
#This Part is not working
- name: Check Azure Version
shell: az --version
#The same playbook
Output from the job is that 1st part did some changes and 2nd one give an error:
"stderr": "/bin/sh: az: command not found",
Any idea how to works with Azure CLI in Ansible AWX/Tower