From 6c7eda4a7b52cc574016f2fb32d8f0a16c032ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Sun, 21 Jun 2026 11:43:05 +0200 Subject: [PATCH] Passwordstore lookup: make directory an INI option (#12298) * Passwordstore lookup: make `directory` an INI option The passwordstore lookup plugin defaults to using the password store tree under ~/.password-store. Being able to configure the directory used for the whole Ansible project helps to use project-specific credentials directory. As `get_option` was already used for this option, this does not require any change in the code itself. * Add related changelog * Update changelogs/fragments/12298-passwordstore-directory-as-ini-option.yml Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein --- .../fragments/12298-passwordstore-directory-as-ini-option.yml | 3 +++ plugins/lookup/passwordstore.py | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 changelogs/fragments/12298-passwordstore-directory-as-ini-option.yml diff --git a/changelogs/fragments/12298-passwordstore-directory-as-ini-option.yml b/changelogs/fragments/12298-passwordstore-directory-as-ini-option.yml new file mode 100644 index 0000000000..f4e856c445 --- /dev/null +++ b/changelogs/fragments/12298-passwordstore-directory-as-ini-option.yml @@ -0,0 +1,3 @@ +--- +minor_changes: + - "passwordstore lookup plugin - make ``directory`` configurable through ``ansible.cfg`` (https://github.com/ansible-collections/community.general/pull/12298)." diff --git a/plugins/lookup/passwordstore.py b/plugins/lookup/passwordstore.py index d3b94cdae8..682da38c72 100644 --- a/plugins/lookup/passwordstore.py +++ b/plugins/lookup/passwordstore.py @@ -25,6 +25,10 @@ options: - If O(backend=gopass), then the default is the C(path) field in C(~/.config/gopass/config.yml), falling back to V(~/.local/share/gopass/stores/root) if C(path) is not defined in the gopass config. type: path + ini: + - section: passwordstore_lookup + key: directory + version_added: 13.2.0 vars: - name: passwordstore env: