azure_preview_modules
azure_preview_modules copied to clipboard
Fix example
huh, that was a tricky one:
- name: Create Vault
hosts: localhost
connection: local
vars:
resource_group_name: testme
resource_group: "{{ resource_group_name }}"
vm_name: testvm
#location: eastus
tasks:
- name: Look up secret when ansible host is general VM
vars:
url: 'https://myVault.vault.azure.net/'
secretname: 'SecretPassword'
client_id: 'ServicePrincipalIDHere'
secret: 'ServicePrinipcalPassHere'
tenant: 'TenantIDHere'
#debug: msg="the value of this secret is {{lookup('azure_keyvault_secret',secret_name,vault_url=url, cliend_id=client_id, secret=secret, tenant_id=tenant)}}"
debug: msg="the value of this secret is {{lookup('azure_keyvault_secret',secret_name,vault_url=url, client_id=client_id, secret=secret, tenant_id=tenant)}}"
msg": "An unhandled exception occurred while running the lookup plugin 'azure_keyvault_secret'. Error was a <class 'ansible.errors.AnsibleError'>, original message: Invalid credentials provided."
only when you debug it at low level (module code) you can see:
msg": "An unhandled exception occurred while running the lookup plugin 'azure_keyvault_secret'. Error was a <class 'msrest.exceptions.AuthenticationError'>, original message: , AdalError: Get Token request returned http error: 400 and server response: {\"error\":\"invalid_request\",\"error_description\":\"AADSTS900144: The request body must contain the following parameter: 'client_id'.
@sirkubax Thank you for taking the time to contribute to this PR. We will transferred ansible 's azure module related Issue and PR to azure collection (https://github.com/ansible-collections/azure/pulls), can you transfer the Issue to azure collection repo?
@sirkubax Repeat with PR #352 before, it is recommended to close. Thank you very much!
@sirkubax Thank you very much for your interest in Ansible. This repo is no longer maintained in this repository and has been migrated to https://github.com/ansible-collections/azure Please re-submit this PR in the above repository and closed this. Thank you very much!