Skip to content

Add ansible-vault plugin - #362

Open
Sirz3chs wants to merge 5 commits into
1Password:mainfrom
Sirz3chs:main
Open

Sirz3chs wants to merge 5 commits into
1Password:mainfrom
Sirz3chs:main

Conversation

@Sirz3chs

@Sirz3chs Sirz3chs commented Aug 1, 2023

Copy link
Copy Markdown

Overview

Add the possibility to use a stored password with ansible-vault to encrypt/decrypt strings and files.

Type of change

  • Created a new plugin
  • Improved an existing plugin
  • Fixed a bug in an existing plugin
  • Improved contributor utilities or experience

Related Issue(s)

  • Resolves: #
  • Relates: #

How To Test

ansible-vault encrypt_string 'bar' --name 'foo' > test.yml

The output file test.yml should be something similar to:

foo: !vault |
          $ANSIBLE_VAULT;1.1;AES256
          35313266333337303865383838653937323735383737366439626361643035656164306232353938
          6363393533346134333362373466343063623661356537300a616266633538323933383139383361
          63613864356137613535356331353536653036656163363336306632653163323365313238666337
          3936613930626366320a356134393765626134346365633134383933633166643637356438356561
          6232

Then to confirm:

ansible localhost -m ansible.builtin.debug -a var="foo" -e "@test.yml"

Changelog

Add the possibilty to use a stored password as password-file to use with ansible-vault.

@arunsathiya
arunsathiya self-requested a review August 1, 2023 12:33
@arunsathiya arunsathiya added the waiting-on-reviewer signals that a certain PR is waiting for a review from a 1Password team member label Aug 1, 2023

@AndyTitu AndyTitu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm to me mostly. I've left a couple of small comments which should be addressed before merging.

Comment thread plugins/ansiblevault/test-fixtures/.ansible-vault Outdated
Comment thread plugins/ansiblevault/password.go Outdated
@AndyTitu AndyTitu added waiting-on-sec-review in-progress this PR is being worked on/comments are in the process of being addressed by the contributor and removed waiting-on-reviewer signals that a certain PR is waiting for a review from a 1Password team member labels Aug 30, 2023
@Sirz3chs

Sirz3chs commented Sep 1, 2023

Copy link
Copy Markdown
Author

@AndyTitu I did the changes

@hculea hculea removed the in-progress this PR is being worked on/comments are in the process of being addressed by the contributor label Sep 19, 2023
Remove the need for string manipulation and instead return the password field directly, to simplify the code for readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants