diff --git a/changelogs/fragments/1493-fix_passwordstore.py_to_be_compatible_with_gopass_versions.yml b/changelogs/fragments/1493-fix_passwordstore.py_to_be_compatible_with_gopass_versions.yml new file mode 100644 index 0000000000..b46fc07a81 --- /dev/null +++ b/changelogs/fragments/1493-fix_passwordstore.py_to_be_compatible_with_gopass_versions.yml @@ -0,0 +1,2 @@ +bugfixes: + - passwordstore lookup plugin - always use explicit ``show`` command to retrieve password. This ensures compatibility with ``gopass`` and avoids problems when password names equal ``pass`` commands (https://github.com/ansible-collections/community.general/pull/1493). diff --git a/plugins/lookup/passwordstore.py b/plugins/lookup/passwordstore.py index ffec2ab6c4..e3d486886c 100644 --- a/plugins/lookup/passwordstore.py +++ b/plugins/lookup/passwordstore.py @@ -204,7 +204,7 @@ class LookupModule(LookupBase): def check_pass(self): try: self.passoutput = to_text( - check_output2(["pass", self.passname], env=self.env), + check_output2(["pass", "show", self.passname], env=self.env), errors='surrogate_or_strict' ).splitlines() self.password = self.passoutput[0]