Skip to content

Commit

Permalink
Merge pull request #660 from tremble/cleanup/check_mode
Browse files Browse the repository at this point in the history
Update remaining _info modules so that they run in check_mode

SUMMARY
Update remaining _info modules so that they run in check_mode
https://github.com/ansible-collections/overview/blob/main/collection_requirements.rst#development-conventions
https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html#following-ansible-conventions
fixes: #659
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
aws_sgw_info
ec2_asg_info
ec2_lc_info
iam_mfa_device_info
iam_server_certificate_info
wafv2_resources_info
wafv2_web_acl_info
ADDITIONAL INFORMATION
cc: @felixfontein
It would be good to get this in before the upcoming sanity check: ansible/ansible#75324
amazon.aws/pull/405
Depends-on: ansible/ansible-zuul-jobs#1014

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Felix Fontein <None>
Reviewed-by: None <None>
  • Loading branch information
ansible-zuul[bot] authored Aug 3, 2021
2 parents be926e3 + 8081e69 commit d1a71fe
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 7 deletions.
8 changes: 8 additions & 0 deletions changelogs/fragments/659-checkmode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
minor_changes:
- aws_sgw_info - ensure module runs in check_mode (https://github.com/ansible-collections/community.aws/issues/659).
- ec2_asg_info - ensure module runs in check_mode (https://github.com/ansible-collections/community.aws/issues/659).
- ec2_lc_info - ensure module runs in check_mode (https://github.com/ansible-collections/community.aws/issues/659).
- iam_mfa_device_info - ensure module runs in check_mode (https://github.com/ansible-collections/community.aws/issues/659).
- iam_server_certificate_info - ensure module runs in check_mode (https://github.com/ansible-collections/community.aws/issues/659).
- wafv2_resources_info - ensure module runs in check_mode (https://github.com/ansible-collections/community.aws/issues/659).
- wafv2_web_acl_info - ensure module runs in check_mode (https://github.com/ansible-collections/community.aws/issues/659).
6 changes: 5 additions & 1 deletion plugins/modules/aws_sgw_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,11 @@ def main():
gather_volumes=dict(type='bool', default=True)
)

module = AnsibleAWSModule(argument_spec=argument_spec)
module = AnsibleAWSModule(
argument_spec=argument_spec,
supports_check_mode=True,
)

if module._name == 'aws_sgw_facts':
module.deprecate("The 'aws_sgw_facts' module has been renamed to 'aws_sgw_info'", date='2021-12-01', collection_name='community.aws')
client = module.client('storagegateway')
Expand Down
7 changes: 6 additions & 1 deletion plugins/modules/ec2_asg_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,12 @@ def main():
name=dict(type='str'),
tags=dict(type='dict'),
)
module = AnsibleAWSModule(argument_spec=argument_spec)

module = AnsibleAWSModule(
argument_spec=argument_spec,
supports_check_mode=True,
)

if module._name == 'ec2_asg_facts':
module.deprecate("The 'ec2_asg_facts' module has been renamed to 'ec2_asg_info'", date='2021-12-01', collection_name='community.aws')

Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/ec2_lc_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ def main():
sort_end=dict(required=False, type='int'),
)

module = AnsibleAWSModule(argument_spec=argument_spec)
module = AnsibleAWSModule(
argument_spec=argument_spec,
supports_check_mode=True,
)

if module._name == 'ec2_lc_facts':
module.deprecate("The 'ec2_lc_facts' module has been renamed to 'ec2_lc_info'", date='2021-12-01', collection_name='community.aws')

Expand Down
5 changes: 4 additions & 1 deletion plugins/modules/iam_mfa_device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ def main():
user_name=dict(required=False, default=None),
)

module = AnsibleAWSModule(argument_spec=argument_spec)
module = AnsibleAWSModule(
argument_spec=argument_spec,
supports_check_mode=True,
)
if module._name == 'iam_mfa_device_facts':
module.deprecate("The 'iam_mfa_device_facts' module has been renamed to 'iam_mfa_device_info'", date='2021-12-01', collection_name='community.aws')

Expand Down
6 changes: 5 additions & 1 deletion plugins/modules/iam_server_certificate_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ def main():
name=dict(type='str'),
)

module = AnsibleAWSModule(argument_spec=argument_spec,)
module = AnsibleAWSModule(
argument_spec=argument_spec,
supports_check_mode=True,
)

if module._name == 'iam_server_certificate_facts':
module.deprecate("The 'iam_server_certificate_facts' module has been renamed to 'iam_server_certificate_info'",
date='2021-12-01', collection_name='community.aws')
Expand Down
3 changes: 2 additions & 1 deletion plugins/modules/wafv2_resources_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def main():
)

module = AnsibleAWSModule(
argument_spec=arg_spec
argument_spec=arg_spec,
supports_check_mode=True,
)

name = module.params.get("name")
Expand Down
3 changes: 2 additions & 1 deletion plugins/modules/wafv2_web_acl_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def main():
)

module = AnsibleAWSModule(
argument_spec=arg_spec
argument_spec=arg_spec,
supports_check_mode=True,
)

state = module.params.get("state")
Expand Down

0 comments on commit d1a71fe

Please sign in to comment.