Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more vars options (token path, token file, validate certs) #95

Merged
merged 2 commits into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelogs/fragments/95-more-vars-options.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
minor_changes:
- hashi_vault lookup - add ``ansible_hashi_vault_token_path`` Ansible vars entry to the ``token_path`` option (https://github.com/ansible-collections/community.hashi_vault/pull/95).
- hashi_vault lookup - add ``ansible_hashi_vault_token_file`` Ansible vars entry to the ``token_file`` option (https://github.com/ansible-collections/community.hashi_vault/pull/95).
- hashi_vault lookup - add ``ansible_hashi_vault_validate_certs`` Ansible vars entry to the ``validate_certs`` option (https://github.com/ansible-collections/community.hashi_vault/pull/95).
3 changes: 3 additions & 0 deletions plugins/doc_fragments/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ class ModuleDocFragment(object):
- Will be populated with the inverse of C(VAULT_SKIP_VERIFY) if that is set and I(validate_certs) is not explicitly provided.
- Will default to C(true) if neither I(validate_certs) or C(VAULT_SKIP_VERIFY) are set.
type: boolean
vars:
- name: ansible_hashi_vault_validate_certs
version_added: '1.2.0'
namespace:
description:
- Vault namespace where secrets reside. This option requires HVAC 0.7.0+ and Vault 0.11+.
Expand Down
6 changes: 6 additions & 0 deletions plugins/lookup/hashi_vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
ini:
- section: lookup_hashi_vault
key: token_path
vars:
- name: ansible_hashi_vault_token_path
version_added: '1.2.0'
token_file:
description: If no token is specified, will try to read the token from this file in I(token_path).
env:
Expand All @@ -71,6 +74,9 @@
ini:
- section: lookup_hashi_vault
key: token_file
vars:
- name: ansible_hashi_vault_token_file
version_added: '1.2.0'
default: '.vault-token'
token_validate:
description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@
- name: 'test {{ auth_type }} auth with certs (validation disabled, lookup parameters)'
include_tasks: '{{ auth_type }}_test.yml'
vars:
conn_params: 'validate_certs=False '
ansible_hashi_vault_validate_certs: False
conn_params: ''