-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wafv2_ip_set - fix bugs with changing description (#1211)
wafv2_ip_set - fix bugs with changing description SUMMARY updating just the description didn't update the changed state ISSUE TYPE Bugfix Pull Request COMPONENT NAME wafv2_ip_set ADDITIONAL INFORMATION Reviewed-by: Markus Bergholz <[email protected]>
- Loading branch information
Showing
4 changed files
with
143 additions
and
5 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,2 @@ | ||
bugfixes: | ||
- wafv2_ip_set - fix bug where incorrect changed state was returned when only changing the description (https://github.com/ansible-collections/community.aws/pull/1211). |
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
131 changes: 131 additions & 0 deletions
131
tests/integration/targets/wafv2_ip_set/tasks/description.yml
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,131 @@ | ||
- name: Tests relating to setting descriptions on wavf2_ip_sets | ||
vars: | ||
description_one: 'a Description - {{ resource_prefix }}' | ||
description_two: 'Another_Description - {{ resource_prefix }}' | ||
# Mandatory settings | ||
module_defaults: | ||
community.aws.wafv2_ip_set: | ||
name: '{{ ip_set_name }}' | ||
state: present | ||
scope: REGIONAL | ||
ip_address_version: IPV4 | ||
purge_addresses: no | ||
addresses: [] | ||
community.aws.wafv2_ip_set_info: | ||
name: '{{ ip_set_name }}' | ||
scope: REGIONAL | ||
block: | ||
|
||
- name: test setting description wafv2_ip_set (check mode) | ||
wafv2_ip_set: | ||
description: '{{ description_one }}' | ||
register: update_result | ||
check_mode: yes | ||
- name: assert that update succeeded | ||
assert: | ||
that: | ||
- update_result is changed | ||
|
||
- name: test setting description wafv2_ip_set | ||
wafv2_ip_set: | ||
description: '{{ description_one }}' | ||
register: update_result | ||
- name: assert that update succeeded | ||
assert: | ||
that: | ||
- update_result is changed | ||
- update_result.description == description_one | ||
|
||
- name: test setting description wafv2_ip_set - idempotency (check mode) | ||
wafv2_ip_set: | ||
description: '{{ description_one }}' | ||
register: update_result | ||
check_mode: yes | ||
- name: assert that update succeeded | ||
assert: | ||
that: | ||
- update_result is not changed | ||
|
||
- name: test setting description wafv2_ip_set - idempotency | ||
wafv2_ip_set: | ||
description: '{{ description_one }}' | ||
register: update_result | ||
- name: assert that update succeeded | ||
assert: | ||
that: | ||
- update_result is not changed | ||
- update_result.description == description_one | ||
|
||
### | ||
|
||
- name: test updating description on wafv2_ip_set (check mode) | ||
wafv2_ip_set: | ||
description: '{{ description_two }}' | ||
register: update_result | ||
check_mode: yes | ||
- name: assert that update succeeded | ||
assert: | ||
that: | ||
- update_result is changed | ||
|
||
- name: test updating description on wafv2_ip_set | ||
wafv2_ip_set: | ||
description: '{{ description_two }}' | ||
register: update_result | ||
- name: assert that update succeeded | ||
assert: | ||
that: | ||
- update_result is changed | ||
- update_result.description == description_two | ||
|
||
- name: test updating description on wafv2_ip_set - idempotency (check mode) | ||
wafv2_ip_set: | ||
description: '{{ description_two }}' | ||
register: update_result | ||
check_mode: yes | ||
- name: assert that update succeeded | ||
assert: | ||
that: | ||
- update_result is not changed | ||
|
||
- name: test updating description on wafv2_ip_set - idempotency | ||
wafv2_ip_set: | ||
description: '{{ description_two }}' | ||
register: update_result | ||
- name: assert that update succeeded | ||
assert: | ||
that: | ||
- update_result is not changed | ||
- update_result.description == description_two | ||
|
||
### | ||
|
||
- name: test that wafv2_ip_set_info returns the description | ||
wafv2_ip_set_info: | ||
register: tag_info | ||
- name: assert description present | ||
assert: | ||
that: | ||
- tag_info.description == description_two | ||
|
||
### | ||
|
||
- name: test no description param wafv2_ip_set (check mode) | ||
wafv2_ip_set: {} | ||
register: update_result | ||
check_mode: yes | ||
- name: assert no change | ||
assert: | ||
that: | ||
- update_result is not changed | ||
- update_result.description == description_two | ||
|
||
|
||
- name: test no description param wafv2_ip_set | ||
wafv2_ip_set: {} | ||
register: update_result | ||
- name: assert no change | ||
assert: | ||
that: | ||
- update_result is not changed | ||
- update_result.description == description_two |
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