mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
add env variable VAULT_AUTH_METHOD (#50572)
This commit is contained in:
parent
100988899a
commit
618caf2168
1 changed files with 3 additions and 1 deletions
|
@ -43,6 +43,8 @@ DOCUMENTATION = """
|
||||||
- name: VAULT_SECRET_ID
|
- name: VAULT_SECRET_ID
|
||||||
auth_method:
|
auth_method:
|
||||||
description: authentication method used
|
description: authentication method used
|
||||||
|
env:
|
||||||
|
- name: VAULT_AUTH_METHOD
|
||||||
mount_point:
|
mount_point:
|
||||||
description: vault mount point, only required if you have a custom mount point
|
description: vault mount point, only required if you have a custom mount point
|
||||||
default: ldap
|
default: ldap
|
||||||
|
@ -139,7 +141,7 @@ class HashiVault:
|
||||||
#
|
#
|
||||||
# to enable a new auth backend, simply add a new 'def auth_<type>' method below.
|
# to enable a new auth backend, simply add a new 'def auth_<type>' 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', ''))
|
self.verify = self.boolean_or_cacert(kwargs.get('validate_certs', True), kwargs.get('cacert', ''))
|
||||||
if self.auth_method and self.auth_method != 'token':
|
if self.auth_method and self.auth_method != 'token':
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue