Skip to content

Commit

Permalink
hashi_vault - add alternate methods (env, ini, vars) for ca_cert op…
Browse files Browse the repository at this point in the history
…tion (#97)

* add env and ansible vars for ca_cert option

* Add changelog fragment for #97

* add INI for ca_cert
  • Loading branch information
briantist committed Jun 19, 2021
1 parent 5a71552 commit 42c0212
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelogs/fragments/97-ca_cert-env-and-vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
minor_changes:
- hashi_vault - add ``ANSIBLE_HASHI_VAULT_CA_CERT`` env var (with ``VAULT_CACERT`` low-precedence fallback) for ``ca_cert`` option (https://github.com/ansible-collections/community.hashi_vault/pull/97).
- hashi_vault - add ``ansible_hashi_vault_ca_cert`` ansible var for ``ca_cert`` option (https://github.com/ansible-collections/community.hashi_vault/pull/97).
- hashi_vault - add ``ca_cert`` INI config file key ``ca_cert`` option (https://github.com/ansible-collections/community.hashi_vault/pull/97).
10 changes: 10 additions & 0 deletions plugins/doc_fragments/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ class ModuleDocFragment(object):
version_added: '1.1.0'
ca_cert:
description: Path to certificate to use for authentication.
env:
- name: ANSIBLE_HASHI_VAULT_CA_CERT
version_added: '1.2.0'
ini:
- section: lookup_hashi_vault
key: ca_cert
version_added: '1.2.0'
vars:
- name: ansible_hashi_vault_ca_cert
version_added: '1.2.0'
aliases: [ cacert ]
validate_certs:
description:
Expand Down
1 change: 1 addition & 0 deletions plugins/module_utils/_hashi_vault_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class HashiVaultOptionGroupBase:
'namespace': ['VAULT_NAMESPACE'],
'token': ['VAULT_TOKEN'],
'url': ['VAULT_ADDR'],
'ca_cert': ['VAULT_CACERT'],
}

def __init__(self, option_adapter):
Expand Down

0 comments on commit 42c0212

Please sign in to comment.