From 618caf21686e0157ab072415c88b4de7a8339526 Mon Sep 17 00:00:00 2001 From: Semyon Deviatkin Date: Mon, 7 Jan 2019 23:13:00 +0200 Subject: [PATCH] add env variable VAULT_AUTH_METHOD (#50572) --- lib/ansible/plugins/lookup/hashi_vault.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/lookup/hashi_vault.py b/lib/ansible/plugins/lookup/hashi_vault.py index 4e78314ade..015fd627f8 100644 --- a/lib/ansible/plugins/lookup/hashi_vault.py +++ b/lib/ansible/plugins/lookup/hashi_vault.py @@ -43,6 +43,8 @@ DOCUMENTATION = """ - name: VAULT_SECRET_ID auth_method: description: authentication method used + env: + - name: VAULT_AUTH_METHOD mount_point: description: vault mount point, only required if you have a custom mount point default: ldap @@ -139,7 +141,7 @@ class HashiVault: # # to enable a new auth backend, simply add a new 'def auth_' method below. # - self.auth_method = kwargs.get('auth_method') + self.auth_method = kwargs.get('auth_method', os.environ.get('VAULT_AUTH_METHOD')) self.verify = self.boolean_or_cacert(kwargs.get('validate_certs', True), kwargs.get('cacert', '')) if self.auth_method and self.auth_method != 'token': try: