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

fix: cast secret data to string in order to allow JSON valued strings #122

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

richm
Copy link
Contributor

@richm richm commented Jan 20, 2024

Cause: Ansible is somehow converting JSON strings to the corresponding
JSON object if the value is used in a loop and the value is used
like data: "{{ value }}"

Consequence: You cannot pass JSON strings as secrets and have the
value preserved.

Fix: Cast the data value to a string when passing to the podman_secret
module.

Result: JSON strings are preserved as-is for use in secrets.

Github issue: #121

Signed-off-by: Rich Megginson rmeggins@redhat.com

Cause: Ansible is somehow converting JSON strings to the corresponding
JSON object if the value is used in a loop and the value is used
like `data: "{{ value }}"`

Consequence: You cannot pass JSON strings as secrets and have the
value preserved.

Fix: Cast the data value to a string when passing to the podman_secret
module.

Result: JSON strings are preserved as-is for use in secrets.

Github issue: linux-system-roles#121

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
@richm
Copy link
Contributor Author

richm commented Jan 20, 2024

[citest]

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM

@richm richm merged commit 278f709 into linux-system-roles:main Jan 22, 2024
15 of 20 checks passed
@richm richm deleted the cast-secret-data-to-string branch January 22, 2024 16:15
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.

None yet

2 participants