Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #8952/24f2b980 backport][stable-9] passwordstore: Support subkey creation and update #8996

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Oct 7, 2024

This is a backport of PR #8952 as merged into main (24f2b98).

SUMMARY

passwordstore lookup - Add the ability to create and update subkeys in password files.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

passwordstore lookup

ADDITIONAL INFORMATION

Here some command lines to illustrate the feature:

# Create a new 'foo' subkey, in an new password store file (in this case, main password is empty)
❯ ansible -m debug -i localhost, -a "msg={{ lookup('community.general.passwordstore', 'example/test', create=true, subkey='foo') }}" localhost
localhost | SUCCESS => {
    "msg": "u6V31gj3d0i3lLbO"
}
# Replace the 'foo' subkey and keep a backup trace in the password file
❯ ansible -m debug -i localhost, -a "msg={{ lookup('community.general.passwordstore', 'example/test', create=true, subkey='foo', overwrite=true, backup=true) }}
" localhost
localhost | SUCCESS => {
    "msg": "8jRMhmn9bE-Ra:Yh"
}
# Replace the main password
❯ ansible -m debug -i localhost, -a "msg={{ lookup('community.general.passwordstore', 'example/test', create=true, overwrite=true) }}" localhost
localhost | SUCCESS => {
    "msg": "Mjol:uhPxIiGcchM"
}
# Display the content of the password file
❯ pass example/test 
Mjol:uhPxIiGcchM

foo: 8jRMhmn9bE-Ra:Yh
lookup_pass: First generated by ansible on 01/10/2024 11:37:25
lookup_pass: old subkey password foo was u6V31gj3d0i3lLbO (Updated on 01/10/2024 11:38:03)

@ansibullbot ansibullbot added backport feature This issue/PR relates to a feature request lookup lookup plugin new_contributor Help guide this first time contributor plugins plugin (any type) labels Oct 7, 2024
@felixfontein felixfontein merged commit 71d8109 into stable-9 Oct 7, 2024
140 checks passed
@felixfontein felixfontein deleted the patchback/backports/stable-9/24f2b980b79cedd199959a29cbfd022cd5791076/pr-8952 branch October 7, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport feature This issue/PR relates to a feature request lookup lookup plugin new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants