-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iam_group - add support for setting the path
- Loading branch information
Showing
9 changed files
with
607 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
minor_changes: | ||
- iam_group - add support for setting group path (https://github.com/ansible-collections/amazon.aws/pull/1892). | ||
- iam_group - adds attached_policies return value (https://github.com/ansible-collections/amazon.aws/pull/1892). | ||
- iam_group - code refactored to avoid single long function (https://github.com/ansible-collections/amazon.aws/pull/1892). |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
--- | ||
test_user: '{{ resource_prefix }}-user' | ||
test_group: '{{ resource_prefix }}-group' | ||
test_path: '/{{ resource_prefix }}-prefix/' | ||
|
||
safe_managed_policy: AWSDenyAll | ||
custom_policy_name: '{{ resource_prefix }}-denyall' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"*" | ||
], | ||
"Effect": "Deny", | ||
"Resource": "*" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
- name: remove group (check_mode) | ||
iam_group: | ||
name: '{{ test_group }}' | ||
state: absent | ||
register: iam_group | ||
check_mode: true | ||
|
||
- assert: | ||
that: | ||
- iam_group is changed | ||
|
||
- name: remove group | ||
iam_group: | ||
name: '{{ test_group }}' | ||
state: absent | ||
register: iam_group | ||
|
||
- assert: | ||
that: | ||
- iam_group is changed | ||
|
||
- name: re-remove group (check_mode) | ||
iam_group: | ||
name: '{{ test_group }}' | ||
state: absent | ||
register: iam_group | ||
check_mode: true | ||
|
||
- assert: | ||
that: | ||
- iam_group is not changed | ||
|
||
- name: re-remove group | ||
iam_group: | ||
name: '{{ test_group }}' | ||
state: absent | ||
register: iam_group | ||
|
||
- assert: | ||
that: | ||
- iam_group is not changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
# Path management | ||
|
||
- name: Set path (check_mode) | ||
iam_group: | ||
name: '{{ test_group }}' | ||
path: '{{ test_path }}' | ||
state: present | ||
register: iam_group | ||
check_mode: true | ||
|
||
- assert: | ||
that: | ||
- iam_group is changed | ||
|
||
- name: Set path | ||
iam_group: | ||
name: '{{ test_group }}' | ||
path: '{{ test_path }}' | ||
state: present | ||
register: iam_group | ||
|
||
- assert: | ||
that: | ||
- iam_group is changed | ||
- "'users' in iam_group.iam_group" | ||
- "'group' in iam_group.iam_group" | ||
- iam_group.iam_group.group.group_name == test_group | ||
- iam_group.iam_group.group.path == test_path | ||
|
||
- name: Retry set path (check_mode) | ||
iam_group: | ||
name: '{{ test_group }}' | ||
path: '{{ test_path }}' | ||
state: present | ||
register: iam_group | ||
check_mode: true | ||
|
||
- assert: | ||
that: | ||
- iam_group is not changed | ||
|
||
- name: Retry set path | ||
iam_group: | ||
name: '{{ test_group }}' | ||
path: '{{ test_path }}' | ||
state: present | ||
register: iam_group | ||
|
||
- assert: | ||
that: | ||
- iam_group is not changed | ||
- "'users' in iam_group.iam_group" | ||
- "'group' in iam_group.iam_group" | ||
- iam_group.iam_group.group.group_name == test_group | ||
- iam_group.iam_group.group.path == test_path | ||
|
||
# /end Path management |
Oops, something went wrong.