Skip to content

Commit

Permalink
update vault_login
Browse files Browse the repository at this point in the history
  • Loading branch information
briantist authored and horazont committed Sep 27, 2022
1 parent 840b85f commit 8d9221f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion plugins/lookup/vault_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- "The C(token) auth method will only return full information if I(token_validate=True).
If the token does not have the C(lookup-self) capability, this will fail. If I(token_validate=False), only the token value itself
will be returned in the structure."
- I(revoke_ephemeral_token) has no effect in this lookup, since the token is the desired result.
extends_documentation_fragment:
- community.hashi_vault.connection
- community.hashi_vault.connection.plugins
Expand Down Expand Up @@ -135,7 +136,7 @@ def run(self, terms, variables=None, **kwargs):

try:
self.authenticator.validate()
response = self.authenticator.authenticate(client)
response = self.authenticator.authenticate(client).raw
except (NotImplementedError, HashiVaultValueError) as e:
raise AnsibleError(e)

Expand Down
3 changes: 2 additions & 1 deletion plugins/modules/vault_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- "In check mode, this module will not perform a login, and will instead return a basic structure with an empty token.
However this may not be useful if the token is required for follow on tasks.
It may be better to use this module with C(check_mode=no) in order to have a valid token that can be used."
- I(revoke_ephemeral_token) has no effect in this module, since the token is the desired result.
options:
token_validate:
description:
Expand Down Expand Up @@ -160,7 +161,7 @@ def run_module():
if module.check_mode:
response = {'auth': {'client_token': None}}
else:
response = module.authenticator.authenticate(client)
response = module.authenticator.authenticate(client).raw
except (NotImplementedError, HashiVaultValueError) as e:
module.fail_json(msg=to_native(e), exception=traceback.format_exc())

Expand Down

0 comments on commit 8d9221f

Please sign in to comment.