community.general/plugins
patchback[bot] 3d2caf3933
passwordstore: Add configurable locking (#4194) (#4243)
* passwordstore: Add configurable locking

Passwordstore cannot be accessed safely in parallel, which causes
various issues:

- When accessing the same path, multiple different secrets are
  returned when the secret didn't exist (missing=create).
- When accessing the same _or different_ paths, multiple pinentry
  dialogs will be spawned by gpg-agent sequentially, having to enter
  the password for the same gpg key multiple times in a row.
- Due to issues in gpg dependencies, accessing gpg-agent in parallel
  is not reliable, causing plays to fail (this can be fixed by adding
  `auto-expand-secmem` to _~/.gnupg/gpg-agent.conf_ though).

These problems have been described in various github issues in the past,
e.g., ansible/ansible#23816 and ansible/ansible#27277.

This cannot be worked around in playbooks by users in a non-error-prone
way.

It is addressed by adding new configuration options:

- lock:
  - readwrite: Lock all operations
  - write: Only lock write operations (default)
  - none: Disable locking
- locktimeout: Time to wait for getting a lock (s/m/h suffix)
  (defaults to 15m)

These options can also be set in ansible.cfg, e.g.:

    [passwordstore_lookup]
    lock=readwrite
    locktimeout=30s

Also, add a note about modifying gpg-agent.conf.

* Tidy up locking config

There is no reason why lock configuration should be part of self.paramvals.
Now locking and its configuration happen all in one place.

* Change timeout description wording to the suggested value.

* Rearrange plugin setup, apply PR feedback

(cherry picked from commit 2416b81aa4)

Co-authored-by: grembo <freebsd@grem.de>
2022-02-21 21:37:47 +01:00
..
action fixed the utf-8 marker (#3162) 2021-08-07 15:02:21 +02:00
become Update BOTMETA, fix some plugin authors, improve BOTMETA extra sanity test (#3069) 2021-07-26 11:44:41 +02:00
cache Fix new devel sanity errors. (#3194) 2021-08-12 12:07:50 +02:00
callback mail: fix the encoding of the mail senders and recipients name (#4061) (#4229) 2022-02-18 22:59:04 +01:00
connection Get rid of distutils.spawn and distutils.util (#3934) (#3974) 2022-01-04 07:22:25 +01:00
doc_fragments Updated keycloak.py to allow defining connection timeout value (#4168) (#4178) (#4198) 2022-02-14 19:56:01 +01:00
filter Add options to filter lists_mergeby (#4058) (#4101) 2022-01-28 12:46:05 +01:00
inventory Fix some more instances of ansible.module_utils._text. (#4232) (#4233) 2022-02-19 08:21:01 +01:00
lookup passwordstore: Add configurable locking (#4194) (#4243) 2022-02-21 21:37:47 +01:00
module_utils Updated keycloak.py to allow defining connection timeout value (#4168) (#4178) (#4198) 2022-02-14 19:56:01 +01:00
modules pmem: Add namespace and namespace_append options (#4225) (#4239) 2022-02-20 22:20:02 +01:00
test a_module test: fix crash in case of tombstoning (#3660) (#3662) 2021-11-04 13:02:18 +01:00