mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix returnall for gopass (#5027)
* Fix returnall for gopass Gopass was always given the --password flag, despite there being no need for this. * Add changelog fragment Co-authored-by: Sylvia van Os <sylvia.van.os@politie.nl>
This commit is contained in:
parent
c64dd16f1c
commit
3eb29eb4b6
3 changed files with 4 additions and 6 deletions
2
changelogs/fragments/5027-fix-returnall-for-gopass.yaml
Normal file
2
changelogs/fragments/5027-fix-returnall-for-gopass.yaml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- passwordstore lookup plugin - fix ``returnall`` for gopass (https://github.com/ansible-collections/community.general/pull/5027).
|
|
@ -261,11 +261,11 @@ class LookupModule(LookupBase):
|
||||||
def is_real_pass(self):
|
def is_real_pass(self):
|
||||||
if self.realpass is None:
|
if self.realpass is None:
|
||||||
try:
|
try:
|
||||||
self.passoutput = to_text(
|
passoutput = to_text(
|
||||||
check_output2([self.pass_cmd, "--version"], env=self.env),
|
check_output2([self.pass_cmd, "--version"], env=self.env),
|
||||||
errors='surrogate_or_strict'
|
errors='surrogate_or_strict'
|
||||||
)
|
)
|
||||||
self.realpass = 'pass: the standard unix password manager' in self.passoutput
|
self.realpass = 'pass: the standard unix password manager' in passoutput
|
||||||
except (subprocess.CalledProcessError) as e:
|
except (subprocess.CalledProcessError) as e:
|
||||||
raise AnsibleError(e)
|
raise AnsibleError(e)
|
||||||
|
|
||||||
|
@ -331,7 +331,6 @@ class LookupModule(LookupBase):
|
||||||
try:
|
try:
|
||||||
self.passoutput = to_text(
|
self.passoutput = to_text(
|
||||||
check_output2([self.pass_cmd, 'show'] +
|
check_output2([self.pass_cmd, 'show'] +
|
||||||
(['--password'] if self.backend == 'gopass' else []) +
|
|
||||||
[self.passname], env=self.env),
|
[self.passname], env=self.env),
|
||||||
errors='surrogate_or_strict'
|
errors='surrogate_or_strict'
|
||||||
).splitlines()
|
).splitlines()
|
||||||
|
|
|
@ -318,9 +318,6 @@
|
||||||
if [ "$1" = "--version" ]; then
|
if [ "$1" = "--version" ]; then
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "show" ] && [ "$2" != "--password" ]; then
|
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
echo "gopass_ok"
|
echo "gopass_ok"
|
||||||
dest: "{{ gopasspath }}"
|
dest: "{{ gopasspath }}"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
Loading…
Reference in a new issue