From c153c8ddeca2da07604f2c49eef943829662f1b8 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Wed, 28 Jul 2021 08:47:51 +0200 Subject: [PATCH] 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: https://github.com/ansible/ansible/pull/75324 --- changelogs/fragments/659-checkmode.yml | 8 ++++++++ plugins/modules/aws_sgw_info.py | 6 +++++- plugins/modules/ec2_asg_info.py | 7 ++++++- plugins/modules/ec2_lc_info.py | 6 +++++- plugins/modules/iam_mfa_device_info.py | 5 ++++- plugins/modules/iam_server_certificate_info.py | 6 +++++- plugins/modules/wafv2_resources_info.py | 3 ++- plugins/modules/wafv2_web_acl_info.py | 3 ++- 8 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 changelogs/fragments/659-checkmode.yml diff --git a/changelogs/fragments/659-checkmode.yml b/changelogs/fragments/659-checkmode.yml new file mode 100644 index 00000000000..d418156bdeb --- /dev/null +++ b/changelogs/fragments/659-checkmode.yml @@ -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) diff --git a/plugins/modules/aws_sgw_info.py b/plugins/modules/aws_sgw_info.py index fac2e346095..37caabf3fd9 100644 --- a/plugins/modules/aws_sgw_info.py +++ b/plugins/modules/aws_sgw_info.py @@ -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') diff --git a/plugins/modules/ec2_asg_info.py b/plugins/modules/ec2_asg_info.py index 0a6cb27d9b0..2b8cf4bc90c 100644 --- a/plugins/modules/ec2_asg_info.py +++ b/plugins/modules/ec2_asg_info.py @@ -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') diff --git a/plugins/modules/ec2_lc_info.py b/plugins/modules/ec2_lc_info.py index d3b81deaa75..ea3832e1234 100644 --- a/plugins/modules/ec2_lc_info.py +++ b/plugins/modules/ec2_lc_info.py @@ -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') diff --git a/plugins/modules/iam_mfa_device_info.py b/plugins/modules/iam_mfa_device_info.py index b04b912549c..78cfe8249d0 100644 --- a/plugins/modules/iam_mfa_device_info.py +++ b/plugins/modules/iam_mfa_device_info.py @@ -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') diff --git a/plugins/modules/iam_server_certificate_info.py b/plugins/modules/iam_server_certificate_info.py index 622e2ee8e86..a37c9e88c83 100644 --- a/plugins/modules/iam_server_certificate_info.py +++ b/plugins/modules/iam_server_certificate_info.py @@ -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') diff --git a/plugins/modules/wafv2_resources_info.py b/plugins/modules/wafv2_resources_info.py index 6ab7aa04ca1..d45c274d481 100644 --- a/plugins/modules/wafv2_resources_info.py +++ b/plugins/modules/wafv2_resources_info.py @@ -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") diff --git a/plugins/modules/wafv2_web_acl_info.py b/plugins/modules/wafv2_web_acl_info.py index 54545c10acc..a0de1131cf6 100644 --- a/plugins/modules/wafv2_web_acl_info.py +++ b/plugins/modules/wafv2_web_acl_info.py @@ -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")