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

iam_policy - add support for diff mode #1375

Merged

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Jul 29, 2022

SUMMARY

fixes: #560

  • Adds support for diff mode
  • renames policies to policy_names so that in future we can return the policies (outside of the diff) too.
  • Attempts to handle AccessDenied more cleanly
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

iam_policy

ADDITIONAL INFORMATION

@@ -35,7 +35,6 @@
policy_json:
description:
- A properly json formatted policy as string.
- See U(https://github.com/ansible/ansible/issues/7005#issuecomment-42894813) on how to use it properly.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note for the reader, we switched to the "JSON" type prior to Ansible 2.10 which makes this reference about Ansible mangling templated JSON strings moot.

@github-actions
Copy link

github-actions bot commented Jul 29, 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 06s
✔️ build-ansible-collection SUCCESS in 4m 49s
✔️ ansible-test-sanity-docker-devel SUCCESS in 10m 06s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 52s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 35s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 27s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 03s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 6m 22s
✔️ ansible-test-splitter SUCCESS in 2m 30s
✔️ integration-community.aws-1 SUCCESS in 5m 24s
⚠️ 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

@ansibullbot
Copy link

@ansibullbot ansibullbot added community_review feature This issue/PR relates to a feature request module module needs_triage owner_pr PR created by owner/maintainer plugins plugin (any type) labels Jul 29, 2022
@markuman markuman added mergeit Merge the PR (SoftwareFactory) backport-4 PR should be backported to the stable-4 branch and removed mergeit Merge the PR (SoftwareFactory) labels Jul 29, 2022
@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Jul 29, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

✔️ ansible-galaxy-importer SUCCESS in 3m 51s
✔️ build-ansible-collection SUCCESS in 5m 10s
✔️ ansible-test-sanity-docker-devel SUCCESS in 10m 25s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 9m 40s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 23s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 32s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 5m 48s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 7m 05s
✔️ ansible-test-splitter SUCCESS in 2m 34s
✔️ integration-community.aws-1 SUCCESS in 5m 23s
⚠️ 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 1ac84c3 into ansible-collections:main Jul 29, 2022
@patchback
Copy link

patchback bot commented Jul 29, 2022

Backport to stable-4: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 1ac84c3 on top of patchback/backports/stable-4/1ac84c305b3853477cb78af35aa89902ac98f1fb/pr-1375

Backporting merged PR #1375 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible-collections/community.aws.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-4/1ac84c305b3853477cb78af35aa89902ac98f1fb/pr-1375 upstream/stable-4
  4. Now, cherry-pick PR iam_policy - add support for diff mode #1375 contents into that branch:
    $ git cherry-pick -x 1ac84c305b3853477cb78af35aa89902ac98f1fb
    If it'll yell at you with something like fatal: Commit 1ac84c305b3853477cb78af35aa89902ac98f1fb is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x 1ac84c305b3853477cb78af35aa89902ac98f1fb
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR iam_policy - add support for diff mode #1375 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-4/1ac84c305b3853477cb78af35aa89902ac98f1fb/pr-1375
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

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

tremble added a commit to tremble/community.aws that referenced this pull request Jul 29, 2022
iam_policy - add support for diff mode

SUMMARY
fixes: ansible-collections#560

Adds support for diff mode
renames policies to policy_names so that in future we can return the policies (outside of the diff) too.
Attempts to handle AccessDenied more cleanly

ISSUE TYPE

Feature Pull Request

COMPONENT NAME
iam_policy
ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell <None>
Reviewed-by: Markus Bergholz <[email protected]>
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Jul 29, 2022
[stable-4] iam_policy - add support for diff mode

SUMMARY
Manual back-port of (#1375)
Adds support for diff mode
renames policies to policy_names so that in future we can return the policies (outside of the diff) too.
Attempts to handle AccessDenied more cleanly
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
iam_policy
ADDITIONAL INFORMATION
Reviewed-by: Markus Bergholz

Reviewed-by: Alina Buzachis <None>
@tremble tremble deleted the issues/560 branch September 9, 2022 09:02
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
iam_policy - add support for diff mode

SUMMARY
fixes: ansible-collections#560

Adds support for diff mode
renames policies to policy_names so that in future we can return the policies (outside of the diff) too.
Attempts to handle AccessDenied more cleanly

ISSUE TYPE

Feature Pull Request

COMPONENT NAME
iam_policy
ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell <None>
Reviewed-by: Markus Bergholz <[email protected]>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@1ac84c3
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
Black-en plugins/plugin_utils

SUMMARY
Minor linting related changes to plugins/plugin_utils
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/plugin_utils
ADDITIONAL INFORMATION
This code hasn't been released yet.

Reviewed-by: Jill R
Reviewed-by: Alina Buzachis
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 mergeit Merge the PR (SoftwareFactory) module module owner_pr PR created by owner/maintainer plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support diff mode for IAM policies
3 participants