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

secretsmanager_secret - Support adding JSON #1333

Merged

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Jul 9, 2022

SUMMARY

fixes: #656

Amazon supports passing JSON in as the secret as a mechanism for storing and retreiving more complex structures.

While in theory it's possible to pass JSON in as a string to secretsmanager_secret. However, because Ansible often does funky things with when templated strings are passed to a parameter (#656) it's non-trivial to pass JSON into secretsmanager_secret.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

secretsmanager_secret

ADDITIONAL INFORMATION

Backstory:

If Ansible sees {{ }} within a string it'll trigger the safe_eval handlers, automatically converting the JSON into a complex structure of lists/dicts, which is then converted to the python string representation of the complex structures - the python string representation is not valid JSON and breaks the AWS integration.

@ansibullbot
Copy link

@ansibullbot ansibullbot added community_review feature This issue/PR relates to a feature request integration tests/integration module module needs_triage plugins plugin (any type) tests tests labels Jul 9, 2022
@github-actions
Copy link

github-actions bot commented Jul 9, 2022

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 4m 18s
✔️ build-ansible-collection SUCCESS in 5m 15s
✔️ ansible-test-sanity-docker-devel SUCCESS in 10m 56s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 16s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 9m 11s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 10m 49s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 5m 05s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 6m 09s
✔️ ansible-test-splitter SUCCESS in 2m 33s
✔️ integration-community.aws-1 SUCCESS in 5m 56s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

Copy link
Contributor

@jatorcasso jatorcasso left a comment

Choose a reason for hiding this comment

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

LGTM! suggested a one-liner since both variables are mutually exclusive

@jatorcasso jatorcasso added the backport-4 PR should be backported to the stable-4 branch label Jul 9, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 4m 21s
✔️ build-ansible-collection SUCCESS in 5m 32s
✔️ ansible-test-sanity-docker-devel SUCCESS in 10m 41s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 50s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 12m 46s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 11m 12s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 38s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 8m 16s
✔️ ansible-test-splitter SUCCESS in 2m 46s
✔️ integration-community.aws-1 SUCCESS in 8m 02s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Jul 10, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

✔️ ansible-galaxy-importer SUCCESS in 4m 08s
✔️ build-ansible-collection SUCCESS in 5m 26s
✔️ ansible-test-sanity-docker-devel SUCCESS in 10m 45s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 20m 03s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 9m 43s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 11m 22s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 50s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 5m 55s
✔️ ansible-test-splitter SUCCESS in 2m 49s
✔️ integration-community.aws-1 SUCCESS in 6m 39s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 5097a76 into ansible-collections:main Jul 10, 2022
@patchback
Copy link

patchback bot commented Jul 10, 2022

Backport to stable-4: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4/5097a76d9f18545172e394f3b846171e893926ad/pr-1333

Backported as #1342

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jul 10, 2022
secretsmanager_secret - Support adding JSON

SUMMARY
fixes: #656
Amazon supports passing JSON in as the secret as a mechanism for storing and retreiving more complex structures.
While in theory it's possible to pass JSON in as a string to secretsmanager_secret.  However, because Ansible often does funky things with when templated strings are passed to a parameter (#656) it's non-trivial to pass JSON into secretsmanager_secret.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
secretsmanager_secret
ADDITIONAL INFORMATION
Backstory:
If Ansible sees {{ }} within a string it'll trigger the safe_eval handlers, automatically converting the JSON into a complex structure of lists/dicts, which is then converted to the python string representation of the complex structures - the python string representation is not valid JSON and breaks the AWS integration.

Reviewed-by: Joseph Torcasso <None>
(cherry picked from commit 5097a76)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Jul 10, 2022
[PR #1333/5097a76d backport][stable-4] secretsmanager_secret - Support adding JSON

This is a backport of PR #1333 as merged into main (5097a76).
SUMMARY
fixes: #656
Amazon supports passing JSON in as the secret as a mechanism for storing and retreiving more complex structures.
While in theory it's possible to pass JSON in as a string to secretsmanager_secret.  However, because Ansible often does funky things with when templated strings are passed to a parameter (#656) it's non-trivial to pass JSON into secretsmanager_secret.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
secretsmanager_secret
ADDITIONAL INFORMATION
Backstory:
If Ansible sees {{ }} within a string it'll trigger the safe_eval handlers, automatically converting the JSON into a complex structure of lists/dicts, which is then converted to the python string representation of the complex structures - the python string representation is not valid JSON and breaks the AWS integration.

Reviewed-by: Mark Chappell <None>
@tremble tremble deleted the issues/656 branch September 9, 2022 09:02
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
Update changelog entries

SUMMARY

Update changelog entries to reflect 3.5.1 and 4.4.0 releases

ISSUE TYPE


Docs Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-4 PR should be backported to the stable-4 branch community_review feature This issue/PR relates to a feature request integration tests/integration mergeit Merge the PR (SoftwareFactory) module module needs_triage plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't pass a dictionary through included task to aws_secret
3 participants