I have a template to create a RG in Azure.
I have also created a Microsoft Azure RM Credentials (with subscription id,client-tenant ids, secret)
However, I’m unable to find any doc reg how to use this credential to authenticate with Azure.
Can anyone guide me how to use this Credential with this playbook
Hi Prashant
Without testing it, I have read this:
- https://docs.ansible.com/ansible-tower/latest/html/userguide/credentials.html#microsoft-azure-resource-manager
- https://docs.ansible.com/ansible/latest/scenario_guides/guide_azure.html
- https://github.com/Azure-Samples/ansible-playbooks#how-to-run
So I think in your playbook/task, you should set some environment variables from template variables, that are filled by Tower:
- name: create vm
env: - AZURE_CLIENT_ID
- AZURE_SECRET
- AZURE_SUBSCRIPTION_ID
azure_rm_virtualmachine:
…
And so on.