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

Add waiter to the iam_role module #767

Merged
merged 7 commits into from
Oct 18, 2021

Conversation

marknet15
Copy link
Contributor

@marknet15 marknet15 commented Oct 16, 2021

SUMMARY

This change adds the wait param used in other AWS modules, adding usage of a waiter for the iam_role creation / updates.

Currently there is no waiting done to ensure the iam_role has actually created and is available before exiting.

The tests have also been split up into separate files to make it a bit more manageable.

Fixes: #710

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

iam_role

ADDITIONAL INFORMATION

Successful run completed of the iam_role integration test suite locally:
ansible-test integration --docker centos8 -v iam_role --allow-unsupported

PLAY RECAP *********************************************************************
testhost                   : ok=198  changed=46   unreachable=0    failed=0    skipped=0    rescued=0    ignored=7   

AWS ACTIONS: ['iam:AddRoleToInstanceProfile', 'iam:AttachRolePolicy', 'iam:CreateInstanceProfile', 'iam:CreatePolicy', 'iam:CreateRole', 'iam:DeleteInstanceProfile', 'iam:DeletePolicy', 'iam:DeleteRole', 'iam:DeleteRolePermissionsBoundary', 'iam:DeleteRolePolicy', 'iam:DetachRolePolicy', 'iam:GetRole', 'iam:GetRolePolicy', 'iam:ListAttachedRolePolicies', 'iam:ListEntitiesForPolicy', 'iam:ListInstanceProfilesForRole', 'iam:ListPolicies', 'iam:ListPolicyVersions', 'iam:ListRolePolicies', 'iam:ListRoleTags', 'iam:ListRoles', 'iam:PutRolePermissionsBoundary', 'iam:PutRolePolicy', 'iam:RemoveRoleFromInstanceProfile', 'iam:TagRole', 'iam:UntagRole', 'iam:UpdateRole']
Run command: docker exec 56cb328c6d9af293d9e820e1f2a94fb8ca87e0769b2b9b6d46bad661f9edde65 tar czf /root/output.tgz --exclude .tmp -C /root/ansible/ansible_collections/community/aws/tests output
Run command: docker exec -i 56cb328c6d9af293d9e820e1f2a94fb8ca87e0769b2b9b6d46bad661f9edde65 dd if=/root/output.tgz bs=65536
Run command: tar oxzf /tmp/ansible-result-k2lnga3v.tgz -C /mnt/c/Users/mark.woolley/Documents/GitHub/public/ansible_collections/community/aws/tests
Run command: docker rm -f 56cb328c6d9af293d9e820e1f2a94fb8ca87e0769b2b9b6d46bad661f9edde65

@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 Oct 16, 2021
Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

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

Thanks for this.

Generally looks good. A couple of minor niggles.

Tests are running fine locally but I did need mattclay/aws-terminator#174

plugins/modules/iam_role.py Show resolved Hide resolved
plugins/modules/iam_role.py Outdated Show resolved Hide resolved
plugins/modules/iam_role.py Outdated Show resolved Hide resolved
marknet15 and others added 3 commits October 18, 2021 09:58
Co-authored-by: Mark Chappell <mchappel@redhat.com>
Co-authored-by: Mark Chappell <mchappel@redhat.com>
@tremble tremble added the gate label Oct 18, 2021
Copy link
Contributor

@ansible-zuul ansible-zuul bot left a comment

Choose a reason for hiding this comment

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

LGTM!

@ansible-zuul ansible-zuul bot merged commit 81d9abd into ansible-collections:main Oct 18, 2021
@tremble
Copy link
Contributor

tremble commented Oct 18, 2021

Thanks @marknet15

@marknet15 marknet15 deleted the add_iam_role_waiter branch October 18, 2021 10:17
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request May 25, 2022
… 3.8 (ansible-collections#767)

Update ec2_instance find_instances to fix incompatibility with Python 3.8

SUMMARY

Update ec2_instance find_instances to use temporary dict. instead of inline changes. Fixes ansible-collections#709

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ec2_instance
ADDITIONAL INFORMATION
Current ec2_module iterates over a filters dictionary to perform hyphen to underscore substitution while popping keys in the process. This is not compatible with Python 3.8. I have simply created a second dictionary, I can also create a shallow copy via the copy() module if the team prefers.

Reviewed-by: Bikouo Aubin <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mark Chappell <None>
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
Add waiter to the iam_role module

SUMMARY
This change adds the wait param used in other AWS modules, adding usage of a waiter for the iam_role creation / updates.
Currently there is no waiting done to ensure the iam_role has actually created and is available before exiting.
The tests have also been split up into separate files to make it a bit more manageable.
Fixes: ansible-collections#710
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
iam_role
ADDITIONAL INFORMATION
Successful run completed of the iam_role integration test suite locally:
ansible-test integration --docker centos8 -v iam_role --allow-unsupported
PLAY RECAP *********************************************************************
testhost                   : ok=198  changed=46   unreachable=0    failed=0    skipped=0    rescued=0    ignored=7

AWS ACTIONS: ['iam:AddRoleToInstanceProfile', 'iam:AttachRolePolicy', 'iam:CreateInstanceProfile', 'iam:CreatePolicy', 'iam:CreateRole', 'iam:DeleteInstanceProfile', 'iam:DeletePolicy', 'iam:DeleteRole', 'iam:DeleteRolePermissionsBoundary', 'iam:DeleteRolePolicy', 'iam:DetachRolePolicy', 'iam:GetRole', 'iam:GetRolePolicy', 'iam:ListAttachedRolePolicies', 'iam:ListEntitiesForPolicy', 'iam:ListInstanceProfilesForRole', 'iam:ListPolicies', 'iam:ListPolicyVersions', 'iam:ListRolePolicies', 'iam:ListRoleTags', 'iam:ListRoles', 'iam:PutRolePermissionsBoundary', 'iam:PutRolePolicy', 'iam:RemoveRoleFromInstanceProfile', 'iam:TagRole', 'iam:UntagRole', 'iam:UpdateRole']
Run command: docker exec 56cb328c6d9af293d9e820e1f2a94fb8ca87e0769b2b9b6d46bad661f9edde65 tar czf /root/output.tgz --exclude .tmp -C /root/ansible/ansible_collections/community/aws/tests output
Run command: docker exec -i 56cb328c6d9af293d9e820e1f2a94fb8ca87e0769b2b9b6d46bad661f9edde65 dd if=/root/output.tgz bs=65536
Run command: tar oxzf /tmp/ansible-result-k2lnga3v.tgz -C /mnt/c/Users/mark.woolley/Documents/GitHub/public/ansible_collections/community/aws/tests
Run command: docker rm -f 56cb328c6d9af293d9e820e1f2a94fb8ca87e0769b2b9b6d46bad661f9edde65

Reviewed-by: Mark Chappell <None>
Reviewed-by: None <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@81d9abd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community_review feature This issue/PR relates to a feature request integration tests/integration module module plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iam_role should have 'wait' option
3 participants