Azure / azure_preview_modules

Azure preview modules for Ansible
https://galaxy.ansible.com/azure/azure_preview_modules
43 stars 49 forks source link

Add timeout to token_res in KeyVault Secret Lookup #379

Open ToniCipriani opened 4 years ago

ToniCipriani commented 4 years ago

https://github.com/Azure/azure_preview_modules/blob/2413dafa6f979a2070843b073830901cc1b1d868/lookup_plugins/azure_keyvault_secret.py#L102

Currently using the plugin with environment variable service principal on a local machine that connects to provision virtual appliances. Calls to authenticate with the vault always get stuck here for a long time. Add a reasonable timeout when not used with MSI, e.g.

token_res = requests.get('http://169.254.169.254/metadata/identity/oauth2/token', params=token_params, headers=token_headers, timeout=10)

Fred-sun commented 4 years ago

@ToniCipriani Thank you very much for your interest in Ansible. This plugin 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.