Fix hashi_vault lookup approle authentication (#1138)

As per the plugin documentation and the Hashicorp Vault documentation (https://www.vaultproject.io/docs/auth/approle#secretid)
secret_id is not mandatory.
Moreover, using this lookup plugin without a secret_id used to work in
Ansible 2.9.

Co-authored-by: Jonathan Piron <jonathanpiron@gmail.com>
This commit is contained in:
Jonathan Piron 2020-11-16 16:42:42 +01:00 committed by GitHub
parent f4c63ede7f
commit 6cec8759d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 75 additions and 1 deletions

View file

@ -588,7 +588,7 @@ class LookupModule(LookupBase):
self.validate_by_required_fields(auth_method, 'username', 'password')
def validate_auth_approle(self, auth_method):
self.validate_by_required_fields(auth_method, 'role_id', 'secret_id')
self.validate_by_required_fields(auth_method, 'role_id')
def validate_auth_token(self, auth_method):
if auth_method == 'token':