Azure: added auth_source to override the source of the credentials (#35213)

* Azure: added auth_source to override the source of the credentials

* removed broken cli auth and fix some review changes

* missed some more cli auth stuff that isn't required

* Added cli auth back in

* Added docs around cli auth

* fix azure CLI auth issues

* tweak error messages
* fix auto fallback to cli
* fix import issues when azure-cli not installed
This commit is contained in:
Jordan Borean 2018-01-23 17:38:05 +10:00 committed by Matt Davis
commit 9e48cf875f
2 changed files with 84 additions and 36 deletions

View file

@ -76,6 +76,20 @@ options:
choices: [validate, ignore]
default: null
version_added: 2.5
auth_source:
description:
- Controls the source of the credentials to use for authentication.
- C(auto) will follow the default precedence of module parameters -> environment variables -> default profile in credential file
C(~/.azure/credentials).
- When set to C(cli), the credentials will be sources from the default Azure CLI profile.
- Can also be set via the C(ANSIBLE_AZURE_AUTH_SOURCE) environment variable.
choices:
- auto
- cli
- credential_file
- env
default: auto
version_added: 2.5
requirements:
- "python >= 2.7"
- "azure >= 2.0.0"