diff --git a/changelogs/fragments/remove_deprecated_facts.yml b/changelogs/fragments/remove_deprecated_facts.yml new file mode 100644 index 00000000000..74c4b38fc6c --- /dev/null +++ b/changelogs/fragments/remove_deprecated_facts.yml @@ -0,0 +1,38 @@ +breaking_changes: + - aws_acm_facts - Remove deprecated alias ``aws_acm_facts``. Please use ``aws_acm_info`` instead. + - aws_kms_facts - Remove deprecated alias ``aws_kms_facts``. Please use ``aws_kms_info`` instead. + - aws_region_facts - Remove deprecated alias ``aws_region_facts``. Please use ``aws_region_info`` instead. + - aws_s3_bucket_facts - Remove deprecated alias ``aws_s3_bucket_facts``. Please use ``aws_s3_bucket_info`` instead. + - aws_sgw_facts - Remove deprecated alias ``aws_sgw_facts``. Please use ``aws_sgw_info`` instead. + - aws_waf_facts - Remove deprecated alias ``aws_waf_facts``. Please use ``aws_waf_info`` instead. + - cloudfront_facts - Remove deprecated alias ``cloudfront_facts``. Please use ``cloudfront_info`` instead. + - cloudwatchlogs_log_group_facts - Remove deprecated alias ``cloudwatchlogs_log_group_facts``. Please use ``cloudwatchlogs_log_group_info`` instead. + - ec2_asg_facts - Remove deprecated alias ``ec2_asg_facts``. Please use ``ec2_asg_info`` instead. + - ec2_customer_gateway_facts - Remove deprecated alias ``ec2_customer_gateway_facts``. Please use ``ec2_customer_gateway_info`` instead. + - ec2_eip_facts - Remove deprecated alias ``ec2_eip_facts``. Please use ``ec2_eip_info`` instead. + - ec2_elb_facts - Remove deprecated alias ``ec2_elb_facts``. Please use ``ec2_elb_info`` instead. + - ec2_lc_facts - Remove deprecated alias ``ec2_lc_facts``. Please use ``ec2_lc_info`` instead. + - ec2_placement_group_facts - Remove deprecated alias ``ec2_placement_group_facts``. Please use ``ec2_placement_group_info`` instead. + - ec2_vpc_nacl_facts - Remove deprecated alias ``ec2_vpc_nacl_facts``. Please use ``ec2_vpc_nacl_info`` instead. + - ec2_vpc_peering_facts - Remove deprecated alias ``ec2_vpc_peering_facts``. Please use ``ec2_vpc_peering_info`` instead. + - ec2_vpc_route_table_facts - Remove deprecated alias ``ec2_vpc_route_table_facts``. Please use ``ec2_vpc_route_table_info`` instead. + - ec2_vpc_vgw_facts - Remove deprecated alias ``ec2_vpc_vgw_facts``. Please use ``ec2_vpc_vgw_info`` instead. + - ec2_vpc_vpn_facts - Remove deprecated alias ``ec2_vpc_vpn_facts``. Please use ``ec2_vpc_vpn_info`` instead. + - ecs_service_facts - Remove deprecated alias ``ecs_service_facts``. Please use ``ecs_service_info`` instead. + - ecs_taskdefinition_facts - Remove deprecated alias ``ecs_taskdefinition_facts``. Please use ``ecs_taskdefinition_info`` instead. + - efs_facts - Remove deprecated alias ``efs_facts``. Please use ``efs_info`` instead. + - elasticache_facts - Remove deprecated alias ``elasticache_facts``. Please use ``elasticache_info`` instead. + - elb_application_lb_facts - Remove deprecated alias ``elb_application_lb_facts``. Please use ``elb_application_lb_info`` instead. + - elb_classic_lb_facts - Remove deprecated alias ``elb_classic_lb_facts``. Please use ``elb_classic_lb_info`` instead. + - elb_target_facts - Remove deprecated alias ``elb_target_facts``. Please use ``elb_target_info`` instead. + - elb_target_group_facts - Remove deprecated alias ``elb_target_group_facts``. Please use ``elb_target_group_info`` instead. + - iam_cert_facts - Remove deprecated alias ``iam_cert_facts``. Please use ``iam_cert_info`` instead. + - iam_mfa_device_facts - Remove deprecated alias ``iam_mfa_device_facts``. Please use ``iam_mfa_device_info`` instead. + - iam_role_facts - Remove deprecated alias ``iam_role_facts``. Please use ``iam_role_info`` instead. + - iam_server_certificate_facts - Remove deprecated alias ``iam_server_certificate_facts``. Please use ``iam_server_certificate_info`` instead. + - lambda_facts - Remove deprecated module lambda_facts``. Please use ``lambda_info`` instead. + - rds_instance_facts - Remove deprecated alias ``rds_instance_facts``. Please use ``rds_instance_info`` instead. + - rds_snapshot_facts - Remove deprecated alias ``rds_snapshot_facts``. Please use ``rds_snapshot_info`` instead. + - redshift_facts - Remove deprecated alias ``redshift_facts``. Please use ``redshift_info`` instead. + - route53_facts - Remove deprecated alias ``route53_facts``. Please use ``route53_info`` instead. + - ec2_elb_info - The ``ec2_elb_info`` module has been removed. Please use ``the ``elb_classic_lb_info`` module. diff --git a/meta/runtime.yml b/meta/runtime.yml index 7a03a7bc077..85367613ace 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -2,7 +2,6 @@ requires_ansible: '>=2.9.10' action_groups: aws: - aws_acm - - aws_acm_facts - aws_acm_info - aws_api_gateway - aws_application_scaling_policy @@ -28,40 +27,33 @@ action_groups: - aws_glue_job - aws_inspector_target - aws_kms - - aws_kms_facts - aws_kms_info - aws_msk_cluster - aws_msk_config - - aws_region_facts - aws_region_info - - aws_s3_bucket_facts - aws_s3_bucket_info - aws_s3_cors - aws_secret - aws_ses_identity - aws_ses_identity_policy - aws_ses_rule_set - - aws_sgw_facts - aws_sgw_info - aws_ssm_parameter_store - aws_step_functions_state_machine - aws_step_functions_state_machine_execution - aws_waf_condition - - aws_waf_facts - aws_waf_info - aws_waf_rule - aws_waf_web_acl - cloudformation_exports_info - cloudformation_stack_set - cloudfront_distribution - - cloudfront_facts - cloudfront_info - cloudfront_invalidation - cloudfront_origin_access_identity - cloudtrail - cloudwatchevent_rule - cloudwatchlogs_log_group - - cloudwatchlogs_log_group_facts - cloudwatchlogs_log_group_info - cloudwatchlogs_log_group_metric_filter - data_pipeline @@ -72,26 +64,20 @@ action_groups: - ec2 - ec2_ami_copy - ec2_asg - - ec2_asg_facts - ec2_asg_info - ec2_asg_lifecycle_hook - ec2_customer_gateway - - ec2_customer_gateway_facts - ec2_customer_gateway_info - ec2_eip - - ec2_eip_facts - ec2_eip_info - ec2_elb - - ec2_elb_facts - ec2_elb_info - ec2_launch_template - ec2_lc - - ec2_lc_facts - ec2_lc_find - ec2_lc_info - ec2_metric_alarm - ec2_placement_group - - ec2_placement_group_facts - ec2_placement_group_info - ec2_scaling_policy - ec2_snapshot_copy @@ -99,54 +85,41 @@ action_groups: - ec2_transit_gateway_info - ec2_vpc_egress_igw - ec2_vpc_nacl - - ec2_vpc_nacl_facts - ec2_vpc_nacl_info - ec2_vpc_peer - - ec2_vpc_peering_facts - ec2_vpc_peering_info - ec2_vpc_route_table - - ec2_vpc_route_table_facts - ec2_vpc_route_table_info - ec2_vpc_vgw - - ec2_vpc_vgw_facts - ec2_vpc_vgw_info - ec2_vpc_vpn - - ec2_vpc_vpn_facts - ec2_vpc_vpn_info - ec2_win_password - ecs_attribute - ecs_cluster - ecs_ecr - ecs_service - - ecs_service_facts - ecs_service_info - ecs_tag - ecs_task - ecs_taskdefinition - - ecs_taskdefinition_facts - ecs_taskdefinition_info - efs - - efs_facts - efs_info - efs_tag - elasticache - - elasticache_facts - elasticache_info - elasticache_parameter_group - elasticache_snapshot - elasticache_subnet_group - elb_application_lb - - elb_application_lb_facts - elb_application_lb_info - elb_classic_lb - - elb_classic_lb_facts - elb_classic_lb_info - elb_instance - elb_network_lb - elb_target - - elb_target_facts - elb_target_group - - elb_target_group_facts - elb_target_group_info - elb_target_info - execute_lambda @@ -154,20 +127,16 @@ action_groups: - iam_access_key - iam_access_key_info - iam_cert - - iam_cert_facts - iam_group - iam_managed_policy - - iam_mfa_device_facts - iam_mfa_device_info - iam_password_policy - iam_policy - iam_policy_info - iam_role - - iam_role_facts - iam_role_info - iam_saml_federation - iam_server_certificate - - iam_server_certificate_facts - iam_server_certificate_info - iam_user - iam_user_info @@ -175,29 +144,24 @@ action_groups: - lambda - lambda_alias - lambda_event - - lambda_facts - lambda_info - lambda_policy - lightsail - rds - rds_instance - - rds_instance_facts - rds_instance_info - rds_instance_snapshot - rds_option_group - rds_option_group_info - rds_param_group - rds_snapshot - - rds_snapshot_facts - rds_snapshot_info - rds_subnet_group - redshift - redshift_cross_region_snapshots - - redshift_facts - redshift_info - redshift_subnet_group - route53 - - route53_facts - route53_health_check - route53_info - route53_zone @@ -222,71 +186,6 @@ action_groups: - wafv2_web_acl_info plugin_routing: modules: - aws_acm_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - aws_acm_facts was renamed in Ansible 2.9 to aws_acm_info. - Please update your tasks. - aws_kms_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - aws_kms_facts was renamed in Ansible 2.9 to aws_kms_info. - Please update your tasks. - aws_region_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - aws_region_facts was renamed in Ansible 2.9 to aws_region_info. - Please update your tasks. - aws_s3_bucket_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - aws_s3_bucket_facts has been deprecated and will be removed. - The aws_s3_bucket_info module returns the same information, but not - as ansible_facts. See the module documentation for more information. - Please update your tasks. - aws_sgw_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - aws_sgw_facts was renamed in Ansible 2.9 to aws_sgw_info. - Please update your tasks. - aws_waf_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - aws_waf_facts was renamed in Ansible 2.9 to aws_waf_info. - Please update your tasks. - cloudfront_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - cloudfront_facts has been deprecated and will be removed. - The cloudfront_info module returns the same information, but not as - ansible_facts. See the module documentation for more information. - cloudwatchlogs_log_group_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - cloudwatchlogs_log_group_facts was renamed in Ansible 2.9 to - cloudwatchlogs_log_group_info. - Please update your tasks. - ec2_asg_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - ec2_asg_facts was renamed in Ansible 2.9 to ec2_asg_info. - Please update your tasks. - ec2_customer_gateway_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - ec2_customer_gateway_facts was renamed in Ansible 2.9 to - ec2_customer_gateway_info. - Please update your tasks. ec2_elb: redirect: community.aws.elb_instance deprecation: @@ -297,23 +196,8 @@ plugin_routing: Please update your tasks. ec2_instance: redirect: amazon.aws.ec2_instance - ec2_instance_facts: - redirect: amazon.aws.ec2_instance_info ec2_instance_info: redirect: amazon.aws.ec2_instance_info - ec2_eip_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - ec2_eip_facts was renamed in Ansible 2.9 to ec2_eip_info. - Please update your tasks. - ec2_elb_facts: - deprecation: - removal_version: 3.0.0 - warning_text: >- - The ec2_elb_info module has been deprecated and replaced by - the elb_classic_lb_info module. - Please update your tasks. ec2_elb_info: deprecation: removal_version: 3.0.0 @@ -321,127 +205,22 @@ plugin_routing: The ec2_elb_info module has been deprecated and replaced by the elb_classic_lb_info module. Please update your tasks. - ec2_lc_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - ec2_lc_facts was renamed in Ansible 2.9 to ec2_lc_info. - Please update your tasks. - ec2_placement_group_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - ec2_placement_group_facts was renamed in Ansible 2.9 to - ec2_placement_group_info. - Please update your tasks. - ec2_vpc_endpoint_facts: - redirect: amazon.aws.ec2_vpc_endpoint_facts ec2_vpc_endpoint: redirect: amazon.aws.ec2_vpc_endpoint ec2_vpc_endpoint_info: redirect: amazon.aws.ec2_vpc_endpoint_info ec2_vpc_endpoint_service_info: redirect: amazon.aws.ec2_vpc_endpoint_service_info - ec2_vpc_igw_facts: - redirect: amazon.aws.ec2_vpc_igw_facts ec2_vpc_igw: redirect: amazon.aws.ec2_vpc_igw ec2_vpc_igw_info: redirect: amazon.aws.ec2_vpc_igw_info - ec2_vpc_nacl_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - ec2_vpc_nacl_facts was renamed in Ansible 2.9 to ec2_vpc_nacl_info. - Please update your tasks. - ec2_vpc_peering_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - ec2_vpc_peering_facts was renamed in Ansible 2.9 to - ec2_vpc_peering_info. - Please update your tasks. - ec2_vpc_route_table_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - ec2_vpc_route_table_facts was renamed in Ansible 2.9 to - ec2_vpc_route_table_info. - Please update your tasks. - ec2_vpc_nat_gateway_facts: - redirect: amazon.aws.ec2_vpc_nat_gateway_facts ec2_vpc_nat_gateway: redirect: amazon.aws.ec2_vpc_nat_gateway ec2_vpc_nat_gateway_info: redirect: amazon.aws.ec2_vpc_nat_gateway_info - ec2_vpc_vgw_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - ec2_vpc_vgw_facts was renamed in Ansible 2.9 to ec2_vpc_vgw_info. - Please update your tasks. - ec2_vpc_vpn_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - ec2_vpc_vpn_facts was renamed in Ansible 2.9 to ec2_vpc_vpn_info. - Please update your tasks. - ecs_service_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - ecs_service_facts has been deprecated and will be removed. - The ecs_service_info module returns the same information, but not as - ansible_facts. See the module documentation for more information. - ecs_taskdefinition_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - ecs_taskdefinition_facts was renamed in Ansible 2.9 to - ecs_taskdefinition_info. - Please update your tasks. - efs_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - efs_facts has been deprecated and will be removed. - The efs_info module returns the same information, but not as - ansible_facts. See the module documentation for more information. - elasticache_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - elasticache_facts was renamed in Ansible 2.9 to elasticache_info. - Please update your tasks. - elb_application_lb_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - elb_application_lb_facts was renamed in Ansible 2.9 to - elb_application_lb_info. - Please update your tasks. elb_classic_lb: redirect: amazon.aws.ec2_elb_lb - elb_classic_lb_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - elb_classic_lb_facts was renamed in Ansible 2.9 to - elb_classic_lb_info. - Please update your tasks. - elb_target_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - elb_target_facts was renamed in Ansible 2.9 to elb_target_info. - Please update your tasks. - elb_target_group_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - elb_target_group_facts was renamed in Ansible 2.9 to - elb_target_group_info. - Please update your tasks. iam: deprecation: removal_version: 3.0.0 @@ -449,24 +228,6 @@ plugin_routing: The iam module is based upon a deprecated version of the AWS SDKs and is deprecated in favor of the iam_user, iam_group and iam_role modules. Please update your tasks. - iam_cert_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - iam_cert_facts was renamed in Ansible 2.9 to iam_server_certificate_info. - Please update your tasks. - iam_mfa_device_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - iam_mfa_device_facts was renamed in Ansible 2.9 to iam_mfa_device_info. - Please update your tasks. - iam_role_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - iam_role_facts was renamed in Ansible 2.9 to iam_role_info. - Please update your tasks. iam_cert: redirect: community.aws.iam_server_certificate deprecation: @@ -474,20 +235,6 @@ plugin_routing: warning_text: >- iam_cert has been renamed to iam_server_certificate for consistency. Please update your tasks. - iam_server_certificate_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - iam_server_certificate_facts was renamed in Ansible 2.9 to - iam_server_certificate_info. - Please update your tasks. - lambda_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - lambda_facts has been deprecated and will be removed. - The lambda_info module returns the same information, but not as - ansible_facts. See the module documentation for more information. rds: deprecation: removal_version: 3.0.0 @@ -495,30 +242,6 @@ plugin_routing: The rds module is based upon a deprecated version of the AWS SDKs and is deprecated in favor of the rds_instance and rds_snapshot modules. Please update your tasks. - rds_instance_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - rds_instance_facts was renamed in Ansible 2.9 to rds_instance_info. - Please update your tasks. - rds_snapshot_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - rds_snapshot_facts was renamed in Ansible 2.9 to rds_snapshot_info. - Please update your tasks. - redshift_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - redshift_facts was renamed in Ansible 2.9 to redshift_info. - Please update your tasks. - route53_facts: - deprecation: - removal_date: 2021-12-01 - warning_text: >- - route53_facts was renamed in Ansible 2.9 to route53_info. - Please update your tasks. rds_snapshot: redirect: community.aws.rds_instance_snapshot deprecation: diff --git a/plugins/modules/aws_acm_facts.py b/plugins/modules/aws_acm_facts.py deleted file mode 120000 index 42dbcf0df95..00000000000 --- a/plugins/modules/aws_acm_facts.py +++ /dev/null @@ -1 +0,0 @@ -aws_acm_info.py \ No newline at end of file diff --git a/plugins/modules/aws_acm_info.py b/plugins/modules/aws_acm_info.py index f0b77b8958f..8d61dde4d3c 100644 --- a/plugins/modules/aws_acm_info.py +++ b/plugins/modules/aws_acm_info.py @@ -12,7 +12,6 @@ version_added: 1.0.0 description: - Retrieve information for ACM certificates - - This module was called C(aws_acm_facts) before Ansible 2.9. The usage did not change. - Note that this will not return information about uploaded keys of size 4096 bits, due to a limitation of the ACM API. options: certificate_arn: @@ -275,9 +274,6 @@ def main(): module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) acm_info = ACMServiceManager(module) - if module._name == 'aws_acm_facts': - module.deprecate("The 'aws_acm_facts' module has been renamed to 'aws_acm_info'", date='2021-12-01', collection_name='community.aws') - client = module.client('acm') certificates = acm_info.get_certificates(client, module, diff --git a/plugins/modules/aws_kms_facts.py b/plugins/modules/aws_kms_facts.py deleted file mode 120000 index ccd052f5199..00000000000 --- a/plugins/modules/aws_kms_facts.py +++ /dev/null @@ -1 +0,0 @@ -aws_kms_info.py \ No newline at end of file diff --git a/plugins/modules/aws_kms_info.py b/plugins/modules/aws_kms_info.py index a7620dad005..5b92b39dba2 100644 --- a/plugins/modules/aws_kms_info.py +++ b/plugins/modules/aws_kms_info.py @@ -13,7 +13,6 @@ short_description: Gather information about AWS KMS keys description: - Gather information about AWS KMS keys including tags and grants - - This module was called C(aws_kms_facts) before Ansible 2.9. The usage did not change. author: "Will Thames (@willthames)" options: alias: @@ -458,8 +457,6 @@ def main(): module = AnsibleAWSModule(argument_spec=argument_spec, mutually_exclusive=[['alias', 'filters', 'key_id']], supports_check_mode=True) - if module._name == 'aws_kms_facts': - module.deprecate("The 'aws_kms_facts' module has been renamed to 'aws_kms_info'", date='2021-12-01', collection_name='community.aws') try: connection = module.client('kms') diff --git a/plugins/modules/aws_region_facts.py b/plugins/modules/aws_region_facts.py deleted file mode 120000 index 03b0d29932e..00000000000 --- a/plugins/modules/aws_region_facts.py +++ /dev/null @@ -1 +0,0 @@ -aws_region_info.py \ No newline at end of file diff --git a/plugins/modules/aws_region_info.py b/plugins/modules/aws_region_info.py index 67b71d6f868..66349e318a8 100644 --- a/plugins/modules/aws_region_info.py +++ b/plugins/modules/aws_region_info.py @@ -12,7 +12,6 @@ version_added: 1.0.0 description: - Gather information about AWS regions. - - This module was called C(aws_region_facts) before Ansible 2.9. The usage did not change. author: 'Henrique Rodrigues (@Sodki)' options: filters: @@ -72,8 +71,6 @@ def main(): ) module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) - if module._name == 'aws_region_facts': - module.deprecate("The 'aws_region_facts' module has been renamed to 'aws_region_info'", date='2021-12-01', collection_name='community.aws') connection = module.client('ec2', retry_decorator=AWSRetry.jittered_backoff()) diff --git a/plugins/modules/aws_s3_bucket_facts.py b/plugins/modules/aws_s3_bucket_facts.py deleted file mode 120000 index 88f68b437a0..00000000000 --- a/plugins/modules/aws_s3_bucket_facts.py +++ /dev/null @@ -1 +0,0 @@ -aws_s3_bucket_info.py \ No newline at end of file diff --git a/plugins/modules/aws_s3_bucket_info.py b/plugins/modules/aws_s3_bucket_info.py index 74b16271a8a..03da910549a 100644 --- a/plugins/modules/aws_s3_bucket_info.py +++ b/plugins/modules/aws_s3_bucket_info.py @@ -16,8 +16,6 @@ short_description: lists S3 buckets in AWS description: - Lists S3 buckets and details about those buckets. - - This module was called C(aws_s3_bucket_facts) before Ansible 2.9, returning C(ansible_facts). - Note that the M(community.aws.aws_s3_bucket_info) module no longer returns C(ansible_facts)! options: name: description: @@ -589,10 +587,6 @@ def main(): # Including ec2 argument spec module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True, mutually_exclusive=mutually_exclusive) - is_old_facts = module._name == 'aws_s3_bucket_facts' - if is_old_facts: - module.deprecate("The 'aws_s3_bucket_facts' module has been renamed to 'aws_s3_bucket_info', " - "and the renamed one no longer returns ansible_facts", date='2021-12-01', collection_name='community.aws') # Get parameters name = module.params.get("name") @@ -623,11 +617,7 @@ def main(): else: result['buckets'] = bucket_list - # Send exit - if is_old_facts: - module.exit_json(msg="Retrieved s3 facts.", ansible_facts=result) - else: - module.exit_json(msg="Retrieved s3 info.", **result) + module.exit_json(msg="Retrieved s3 info.", **result) # MAIN diff --git a/plugins/modules/aws_sgw_facts.py b/plugins/modules/aws_sgw_facts.py deleted file mode 120000 index 0af0560a3b2..00000000000 --- a/plugins/modules/aws_sgw_facts.py +++ /dev/null @@ -1 +0,0 @@ -aws_sgw_info.py \ No newline at end of file diff --git a/plugins/modules/aws_sgw_info.py b/plugins/modules/aws_sgw_info.py index e59f8ecf9f1..f49299947be 100644 --- a/plugins/modules/aws_sgw_info.py +++ b/plugins/modules/aws_sgw_info.py @@ -15,7 +15,6 @@ short_description: Fetch AWS Storage Gateway information description: - Fetch AWS Storage Gateway information - - This module was called C(aws_sgw_facts) before Ansible 2.9. The usage did not change. author: Loic Blot (@nerzhul) options: gather_local_disks: @@ -348,8 +347,6 @@ def main(): 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') if client is None: # this should never happen diff --git a/plugins/modules/aws_waf_facts.py b/plugins/modules/aws_waf_facts.py deleted file mode 120000 index 3fd538387ac..00000000000 --- a/plugins/modules/aws_waf_facts.py +++ /dev/null @@ -1 +0,0 @@ -aws_waf_info.py \ No newline at end of file diff --git a/plugins/modules/aws_waf_info.py b/plugins/modules/aws_waf_info.py index 9a1015d6858..838f9491dfd 100644 --- a/plugins/modules/aws_waf_info.py +++ b/plugins/modules/aws_waf_info.py @@ -12,7 +12,6 @@ version_added: 1.0.0 description: - Retrieve information for WAF ACLs, Rule , Conditions and Filters. - - This module was called C(aws_waf_facts) before Ansible 2.9. The usage did not change. options: name: description: @@ -125,8 +124,6 @@ def main(): waf_regional=dict(type='bool', default=False) ) module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) - if module._name == 'aws_waf_facts': - module.deprecate("The 'aws_waf_facts' module has been renamed to 'aws_waf_info'", date='2021-12-01', collection_name='community.aws') resource = 'waf' if not module.params['waf_regional'] else 'waf-regional' client = module.client(resource) diff --git a/plugins/modules/cloudfront_facts.py b/plugins/modules/cloudfront_facts.py deleted file mode 120000 index 700056e714c..00000000000 --- a/plugins/modules/cloudfront_facts.py +++ /dev/null @@ -1 +0,0 @@ -cloudfront_info.py \ No newline at end of file diff --git a/plugins/modules/cloudfront_info.py b/plugins/modules/cloudfront_info.py index be8481a40ae..e9136341c9f 100644 --- a/plugins/modules/cloudfront_info.py +++ b/plugins/modules/cloudfront_info.py @@ -13,8 +13,6 @@ short_description: Obtain facts about an AWS CloudFront distribution description: - Gets information about an AWS CloudFront distribution. - - This module was called C(cloudfront_facts) before Ansible 2.9, returning C(ansible_facts). - Note that the M(community.aws.cloudfront_info) module no longer returns C(ansible_facts)! author: Willem van Ketwich (@wilvk) options: distribution_id: @@ -171,22 +169,6 @@ - ansible.builtin.debug: msg: "{{ result_website['cloudfront']['www.my-website.com'] }}" -# When the module is called as cloudfront_facts, return values are published -# in ansible_facts['cloudfront'][] and can be used as follows. -# Note that this is deprecated and will stop working in a release after 2021-12-01. -- name: Gather facts - community.aws.cloudfront_facts: - distribution: true - distribution_id: my-cloudfront-distribution-id -- ansible.builtin.debug: - msg: "{{ ansible_facts['cloudfront']['my-cloudfront-distribution-id'] }}" - -- community.aws.cloudfront_facts: - distribution: true - domain_name_alias: www.my-website.com -- ansible.builtin.debug: - msg: "{{ ansible_facts['cloudfront']['www.my-website.com'] }}" - - name: Get all information about an invalidation for a distribution. community.aws.cloudfront_info: invalidation: true @@ -545,10 +527,6 @@ def main(): ) module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) - is_old_facts = module._name == 'cloudfront_facts' - if is_old_facts: - module.deprecate("The 'cloudfront_facts' module has been renamed to 'cloudfront_info', " - "and the renamed one no longer returns ansible_facts", date='2021-12-01', collection_name='community.aws') service_mgr = CloudFrontServiceManager(module) @@ -658,10 +636,8 @@ def main(): result['changed'] = False result['cloudfront'].update(facts) - if is_old_facts: - module.exit_json(msg="Retrieved CloudFront facts.", ansible_facts=result) - else: - module.exit_json(msg="Retrieved CloudFront info.", **result) + + module.exit_json(msg="Retrieved CloudFront info.", **result) if __name__ == '__main__': diff --git a/plugins/modules/cloudwatchlogs_log_group_facts.py b/plugins/modules/cloudwatchlogs_log_group_facts.py deleted file mode 120000 index 402937478ad..00000000000 --- a/plugins/modules/cloudwatchlogs_log_group_facts.py +++ /dev/null @@ -1 +0,0 @@ -cloudwatchlogs_log_group_info.py \ No newline at end of file diff --git a/plugins/modules/cloudwatchlogs_log_group_info.py b/plugins/modules/cloudwatchlogs_log_group_info.py index c53e501717f..ff80191790d 100644 --- a/plugins/modules/cloudwatchlogs_log_group_info.py +++ b/plugins/modules/cloudwatchlogs_log_group_info.py @@ -14,7 +14,6 @@ short_description: Get information about log_group in CloudWatchLogs description: - Lists the specified log groups. You can list all your log groups or filter the results by prefix. - - This module was called C(cloudwatchlogs_log_group_facts) before Ansible 2.9. The usage did not change. author: - Willian Ricardo (@willricardo) options: @@ -98,9 +97,6 @@ def main(): ) module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) - if module._name == 'cloudwatchlogs_log_group_facts': - module.deprecate("The 'cloudwatchlogs_log_group_facts' module has been renamed to 'cloudwatchlogs_log_group_info'", - date='2021-12-01', collection_name='community.aws') try: logs = module.client('logs') diff --git a/plugins/modules/ec2_asg_facts.py b/plugins/modules/ec2_asg_facts.py deleted file mode 120000 index 88ec9524588..00000000000 --- a/plugins/modules/ec2_asg_facts.py +++ /dev/null @@ -1 +0,0 @@ -ec2_asg_info.py \ No newline at end of file diff --git a/plugins/modules/ec2_asg_info.py b/plugins/modules/ec2_asg_info.py index 2b8cf4bc90c..55d463e096b 100644 --- a/plugins/modules/ec2_asg_info.py +++ b/plugins/modules/ec2_asg_info.py @@ -13,7 +13,6 @@ short_description: Gather information about ec2 Auto Scaling Groups (ASGs) in AWS description: - Gather information about ec2 Auto Scaling Groups (ASGs) in AWS - - This module was called C(ec2_asg_facts) before Ansible 2.9. The usage did not change. author: "Rob White (@wimnat)" options: name: @@ -444,9 +443,6 @@ def main(): 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') - asg_name = module.params.get('name') asg_tags = module.params.get('tags') diff --git a/plugins/modules/ec2_customer_gateway_facts.py b/plugins/modules/ec2_customer_gateway_facts.py deleted file mode 120000 index 2e1aec0aba5..00000000000 --- a/plugins/modules/ec2_customer_gateway_facts.py +++ /dev/null @@ -1 +0,0 @@ -ec2_customer_gateway_info.py \ No newline at end of file diff --git a/plugins/modules/ec2_customer_gateway_info.py b/plugins/modules/ec2_customer_gateway_info.py index ab8ac41e505..7b55d433b99 100644 --- a/plugins/modules/ec2_customer_gateway_info.py +++ b/plugins/modules/ec2_customer_gateway_info.py @@ -13,7 +13,6 @@ short_description: Gather information about customer gateways in AWS description: - Gather information about customer gateways in AWS. - - This module was called C(ec2_customer_gateway_facts) before Ansible 2.9. The usage did not change. author: Madhura Naniwadekar (@Madhura-CSI) options: filters: @@ -125,9 +124,6 @@ def main(): module = AnsibleAWSModule(argument_spec=argument_spec, mutually_exclusive=[['customer_gateway_ids', 'filters']], supports_check_mode=True) - if module._module._name == 'ec2_customer_gateway_facts': - module._module.deprecate("The 'ec2_customer_gateway_facts' module has been renamed to 'ec2_customer_gateway_info'", - date='2021-12-01', collection_name='community.aws') connection = module.client('ec2') diff --git a/plugins/modules/ec2_eip_facts.py b/plugins/modules/ec2_eip_facts.py deleted file mode 120000 index 0ba519697bd..00000000000 --- a/plugins/modules/ec2_eip_facts.py +++ /dev/null @@ -1 +0,0 @@ -ec2_eip_info.py \ No newline at end of file diff --git a/plugins/modules/ec2_eip_info.py b/plugins/modules/ec2_eip_info.py index e38735c087e..4f560429e12 100644 --- a/plugins/modules/ec2_eip_info.py +++ b/plugins/modules/ec2_eip_info.py @@ -13,7 +13,6 @@ short_description: List EC2 EIP details description: - List details of EC2 Elastic IP addresses. - - This module was called C(ec2_eip_facts) before Ansible 2.9. The usage did not change. author: "Brad Macpherson (@iiibrad)" options: filters: @@ -137,8 +136,6 @@ def main(): ), supports_check_mode=True ) - if module._module._name == 'ec2_eip_facts': - module._module.deprecate("The 'ec2_eip_facts' module has been renamed to 'ec2_eip_info'", date='2021-12-01', collection_name='community.aws') module.exit_json(changed=False, addresses=get_eips_details(module)) diff --git a/plugins/modules/ec2_elb_facts.py b/plugins/modules/ec2_elb_facts.py deleted file mode 120000 index a029c6d0b08..00000000000 --- a/plugins/modules/ec2_elb_facts.py +++ /dev/null @@ -1 +0,0 @@ -ec2_elb_info.py \ No newline at end of file diff --git a/plugins/modules/ec2_elb_info.py b/plugins/modules/ec2_elb_info.py deleted file mode 100644 index ab74e11e0d6..00000000000 --- a/plugins/modules/ec2_elb_info.py +++ /dev/null @@ -1,264 +0,0 @@ -#!/usr/bin/python -# -# This is a free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This Ansible library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this library. If not, see . - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - - -DOCUMENTATION = r''' ---- -module: ec2_elb_info -version_added: 1.0.0 -deprecated: - removed_in: 3.0.0 - why: The ec2_elb_info is based upon a deprecated version of the AWS SDK. - alternative: Use M(community.aws.elb_classic_lb_info). -short_description: Gather information about EC2 Elastic Load Balancers in AWS -description: - - Gather information about EC2 Elastic Load Balancers in AWS - - This module was called C(ec2_elb_facts) before Ansible 2.9. The usage did not change. -author: - - "Michael Schultz (@mjschultz)" - - "Fernando Jose Pando (@nand0p)" -options: - names: - description: - - List of ELB names to gather information about. Pass this option to gather information about a set of ELBs, otherwise, all ELBs are returned. - type: list - elements: str -extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -requirements: -- boto >= 2.49.0 -''' - -EXAMPLES = r''' -# Note: These examples do not set authentication details, see the AWS Guide for details. -# Output format tries to match amazon.aws.ec2_elb_lb module input parameters - -- name: Gather information about all ELBs - community.aws.ec2_elb_info: - register: elb_info -- ansible.builtin.debug: - msg: "{{ item.dns_name }}" - loop: "{{ elb_info.elbs }}" - -- name: Gather information about a particular ELB - community.aws.ec2_elb_info: - names: frontend-prod-elb - register: elb_info - -- ansible.builtin.debug: - msg: "{{ elb_info.elbs.0.dns_name }}" - -- name: Gather information about a set of ELBs - community.aws.ec2_elb_info: - names: - - frontend-prod-elb - - backend-prod-elb - register: elb_info - -- ansible.builtin.debug: - msg: "{{ item.dns_name }}" - loop: "{{ elb_info.elbs }}" - -''' - -import traceback - -try: - import boto.ec2.elb - from boto.ec2.tag import Tag - from boto.exception import BotoServerError -except ImportError: - pass # Handled by ec2.HAS_BOTO - -from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule -from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry -from ansible_collections.amazon.aws.plugins.module_utils.ec2 import connect_to_aws -from ansible_collections.amazon.aws.plugins.module_utils.ec2 import get_aws_connection_info -from ansible_collections.amazon.aws.plugins.module_utils.ec2 import HAS_BOTO - - -class ElbInformation(object): - """Handles ELB information.""" - - def __init__(self, module, names, region, **aws_connect_params): - - self.module = module - self.names = names - self.region = region - self.aws_connect_params = aws_connect_params - self.connection = self._get_elb_connection() - - def _get_tags(self, elbname): - params = {'LoadBalancerNames.member.1': elbname} - elb_tags = self.connection.get_list('DescribeTags', params, [('member', Tag)]) - return dict((tag.Key, tag.Value) for tag in elb_tags if hasattr(tag, 'Key')) - - @AWSRetry.jittered_backoff(retries=5, delay=5, backoff=2.0) - def _get_elb_connection(self): - return connect_to_aws(boto.ec2.elb, self.region, **self.aws_connect_params) - - def _get_elb_listeners(self, listeners): - listener_list = [] - - for listener in listeners: - listener_dict = { - 'load_balancer_port': listener[0], - 'instance_port': listener[1], - 'protocol': listener[2], - 'instance_protocol': listener[3] - } - - try: - ssl_certificate_id = listener[4] - except IndexError: - pass - else: - if ssl_certificate_id: - listener_dict['ssl_certificate_id'] = ssl_certificate_id - - listener_list.append(listener_dict) - - return listener_list - - def _get_health_check(self, health_check): - protocol, port_path = health_check.target.split(':') - try: - port, path = port_path.split('/', 1) - path = '/{0}'.format(path) - except ValueError: - port = port_path - path = None - - health_check_dict = { - 'ping_protocol': protocol.lower(), - 'ping_port': int(port), - 'response_timeout': health_check.timeout, - 'interval': health_check.interval, - 'unhealthy_threshold': health_check.unhealthy_threshold, - 'healthy_threshold': health_check.healthy_threshold, - } - - if path: - health_check_dict['ping_path'] = path - return health_check_dict - - @AWSRetry.jittered_backoff(retries=5, delay=5, backoff=2.0) - def _get_elb_info(self, elb): - elb_info = { - 'name': elb.name, - 'zones': elb.availability_zones, - 'dns_name': elb.dns_name, - 'canonical_hosted_zone_name': elb.canonical_hosted_zone_name, - 'canonical_hosted_zone_name_id': elb.canonical_hosted_zone_name_id, - 'hosted_zone_name': elb.canonical_hosted_zone_name, - 'hosted_zone_id': elb.canonical_hosted_zone_name_id, - 'instances': [instance.id for instance in elb.instances], - 'listeners': self._get_elb_listeners(elb.listeners), - 'scheme': elb.scheme, - 'security_groups': elb.security_groups, - 'health_check': self._get_health_check(elb.health_check), - 'subnets': elb.subnets, - 'instances_inservice': [], - 'instances_inservice_count': 0, - 'instances_outofservice': [], - 'instances_outofservice_count': 0, - 'instances_inservice_percent': 0.0, - 'tags': self._get_tags(elb.name) - } - - if elb.vpc_id: - elb_info['vpc_id'] = elb.vpc_id - - if elb.instances: - instance_health = self.connection.describe_instance_health(elb.name) - elb_info['instances_inservice'] = [inst.instance_id for inst in instance_health if inst.state == 'InService'] - elb_info['instances_inservice_count'] = len(elb_info['instances_inservice']) - elb_info['instances_outofservice'] = [inst.instance_id for inst in instance_health if inst.state == 'OutOfService'] - elb_info['instances_outofservice_count'] = len(elb_info['instances_outofservice']) - try: - elb_info['instances_inservice_percent'] = ( - float(elb_info['instances_inservice_count']) / - float(elb_info['instances_inservice_count'] + elb_info['instances_outofservice_count']) - ) * 100. - except ZeroDivisionError: - elb_info['instances_inservice_percent'] = 0. - return elb_info - - def list_elbs(self): - elb_array, token = [], None - get_elb_with_backoff = AWSRetry.jittered_backoff(retries=5, delay=5, backoff=2.0)(self.connection.get_all_load_balancers) - while True: - all_elbs = get_elb_with_backoff(marker=token) - token = all_elbs.next_marker - - if all_elbs: - if self.names: - for existing_lb in all_elbs: - if existing_lb.name in self.names: - elb_array.append(existing_lb) - else: - elb_array.extend(all_elbs) - else: - break - - if token is None: - break - - return list(map(self._get_elb_info, elb_array)) - - -def main(): - argument_spec = dict( - names={'default': [], 'type': 'list', 'elements': 'str'} - ) - module = AnsibleAWSModule(argument_spec=argument_spec, - supports_check_mode=True) - - if module._name == 'ec2_elb_facts': - # The ec2_elb_facts alias was already deprecated - module.deprecate("The 'ec2_elb_facts' module has been deprecated and replaced by the 'elb_classic_lb_info' module'", - version='3.0.0', collection_name='community.aws') - if module._name == 'ec2_elb_info': - module.deprecate("The 'ec2_elb_info' module has been deprecated and replaced by the 'elb_classic_lb_info' module'", - version='3.0.0', collection_name='community.aws') - - if not HAS_BOTO: - module.fail_json(msg='boto required for this module') - - try: - region, ec2_url, aws_connect_params = get_aws_connection_info(module) - if not region: - module.fail_json(msg="region must be specified") - - names = module.params['names'] - elb_information = ElbInformation( - module, names, region, **aws_connect_params) - - ec2_info_result = dict(changed=False, - elbs=elb_information.list_elbs()) - - except BotoServerError as err: - module.fail_json(msg="{0}: {1}".format(err.error_code, err.error_message), - exception=traceback.format_exc()) - - module.exit_json(**ec2_info_result) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/ec2_lc_facts.py b/plugins/modules/ec2_lc_facts.py deleted file mode 120000 index cb62597c074..00000000000 --- a/plugins/modules/ec2_lc_facts.py +++ /dev/null @@ -1 +0,0 @@ -ec2_lc_info.py \ No newline at end of file diff --git a/plugins/modules/ec2_lc_info.py b/plugins/modules/ec2_lc_info.py index ea3832e1234..d05bf9876b4 100644 --- a/plugins/modules/ec2_lc_info.py +++ b/plugins/modules/ec2_lc_info.py @@ -14,7 +14,6 @@ short_description: Gather information about AWS Autoscaling Launch Configurations. description: - Gather information about AWS Autoscaling Launch Configurations. - - This module was called C(ec2_lc_facts) before Ansible 2.9. The usage did not change. author: "Loïc Latreille (@psykotox)" options: name: @@ -212,9 +211,6 @@ def main(): 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') - try: connection = module.client('autoscaling') except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: diff --git a/plugins/modules/ec2_placement_group_facts.py b/plugins/modules/ec2_placement_group_facts.py deleted file mode 120000 index 7d33ef0167f..00000000000 --- a/plugins/modules/ec2_placement_group_facts.py +++ /dev/null @@ -1 +0,0 @@ -ec2_placement_group_info.py \ No newline at end of file diff --git a/plugins/modules/ec2_placement_group_info.py b/plugins/modules/ec2_placement_group_info.py index 354d3eb3276..6a344f1d8d9 100644 --- a/plugins/modules/ec2_placement_group_info.py +++ b/plugins/modules/ec2_placement_group_info.py @@ -13,7 +13,6 @@ short_description: List EC2 Placement Group(s) details description: - List details of EC2 Placement Group(s). - - This module was called C(ec2_placement_group_facts) before Ansible 2.9. The usage did not change. author: "Brad Macpherson (@iiibrad)" options: names: @@ -114,9 +113,6 @@ def main(): argument_spec=argument_spec, supports_check_mode=True ) - if module._module._name == 'ec2_placement_group_facts': - module._module.deprecate("The 'ec2_placement_group_facts' module has been renamed to 'ec2_placement_group_info'", - date='2021-12-01', collection_name='community.aws') connection = module.client('ec2') diff --git a/plugins/modules/ec2_vpc_nacl_facts.py b/plugins/modules/ec2_vpc_nacl_facts.py deleted file mode 120000 index a88962d88f4..00000000000 --- a/plugins/modules/ec2_vpc_nacl_facts.py +++ /dev/null @@ -1 +0,0 @@ -ec2_vpc_nacl_info.py \ No newline at end of file diff --git a/plugins/modules/ec2_vpc_nacl_info.py b/plugins/modules/ec2_vpc_nacl_info.py index 88786bf76ca..b8d256470ee 100644 --- a/plugins/modules/ec2_vpc_nacl_info.py +++ b/plugins/modules/ec2_vpc_nacl_info.py @@ -12,7 +12,6 @@ short_description: Gather information about Network ACLs in an AWS VPC description: - Gather information about Network ACLs in an AWS VPC - - This module was called C(ec2_vpc_nacl_facts) before Ansible 2.9. The usage did not change. author: "Brad Davidson (@brandond)" options: nacl_ids: @@ -207,8 +206,6 @@ def main(): filters=dict(default={}, type='dict')) module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) - if module._name == 'ec2_vpc_nacl_facts': - module.deprecate("The 'ec2_vpc_nacl_facts' module has been renamed to 'ec2_vpc_nacl_info'", date='2021-12-01', collection_name='community.aws') connection = module.client('ec2', retry_decorator=AWSRetry.jittered_backoff()) diff --git a/plugins/modules/ec2_vpc_peering_facts.py b/plugins/modules/ec2_vpc_peering_facts.py deleted file mode 120000 index 074baf65a0f..00000000000 --- a/plugins/modules/ec2_vpc_peering_facts.py +++ /dev/null @@ -1 +0,0 @@ -ec2_vpc_peering_info.py \ No newline at end of file diff --git a/plugins/modules/ec2_vpc_peering_info.py b/plugins/modules/ec2_vpc_peering_info.py index f43d1378aa8..e7d8264c8d5 100644 --- a/plugins/modules/ec2_vpc_peering_info.py +++ b/plugins/modules/ec2_vpc_peering_info.py @@ -12,7 +12,6 @@ version_added: 1.0.0 description: - Gets various details related to AWS VPC Peers - - This module was called C(ec2_vpc_peering_facts) before Ansible 2.9. The usage did not change. options: peer_connection_ids: description: @@ -235,8 +234,6 @@ def main(): module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True,) - if module._name == 'ec2_vpc_peering_facts': - module.deprecate("The 'ec2_vpc_peering_facts' module has been renamed to 'ec2_vpc_peering_info'", date='2021-12-01', collection_name='community.aws') try: ec2 = module.client('ec2', retry_decorator=AWSRetry.jittered_backoff()) diff --git a/plugins/modules/ec2_vpc_route_table_facts.py b/plugins/modules/ec2_vpc_route_table_facts.py deleted file mode 120000 index ed0f72a1aa3..00000000000 --- a/plugins/modules/ec2_vpc_route_table_facts.py +++ /dev/null @@ -1 +0,0 @@ -ec2_vpc_route_table_info.py \ No newline at end of file diff --git a/plugins/modules/ec2_vpc_route_table_info.py b/plugins/modules/ec2_vpc_route_table_info.py index 2e4dd384930..a84245d47ee 100644 --- a/plugins/modules/ec2_vpc_route_table_info.py +++ b/plugins/modules/ec2_vpc_route_table_info.py @@ -13,7 +13,6 @@ short_description: Gather information about ec2 VPC route tables in AWS description: - Gather information about ec2 VPC route tables in AWS - - This module was called C(ec2_vpc_route_table_facts) before Ansible 2.9. The usage did not change. author: - "Rob White (@wimnat)" - "Mark Chappell (@tremble)" @@ -270,9 +269,6 @@ def main(): module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) - if module._name == 'ec2_vpc_route_table_facts': - module.deprecate("The 'ec2_vpc_route_table_facts' module has been renamed to 'ec2_vpc_route_table_info'", - date='2021-12-01', collection_name='community.aws') connection = module.client('ec2', retry_decorator=AWSRetry.jittered_backoff(retries=10)) diff --git a/plugins/modules/ec2_vpc_vgw_facts.py b/plugins/modules/ec2_vpc_vgw_facts.py deleted file mode 120000 index bbcf44bef40..00000000000 --- a/plugins/modules/ec2_vpc_vgw_facts.py +++ /dev/null @@ -1 +0,0 @@ -ec2_vpc_vgw_info.py \ No newline at end of file diff --git a/plugins/modules/ec2_vpc_vgw_info.py b/plugins/modules/ec2_vpc_vgw_info.py index 7cb7b15798e..aa4a4719ffe 100644 --- a/plugins/modules/ec2_vpc_vgw_info.py +++ b/plugins/modules/ec2_vpc_vgw_info.py @@ -13,7 +13,6 @@ short_description: Gather information about virtual gateways in AWS description: - Gather information about virtual gateways in AWS. - - This module was called C(ec2_vpc_vgw_facts) before Ansible 2.9. The usage did not change. options: filters: description: @@ -134,8 +133,6 @@ def main(): ) module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) - if module._name == 'ec2_vpc_vgw_facts': - module.deprecate("The 'ec2_vpc_vgw_facts' module has been renamed to 'ec2_vpc_vgw_info'", date='2021-12-01', collection_name='community.aws') try: connection = module.client('ec2') diff --git a/plugins/modules/ec2_vpc_vpn_facts.py b/plugins/modules/ec2_vpc_vpn_facts.py deleted file mode 120000 index 671a1a30341..00000000000 --- a/plugins/modules/ec2_vpc_vpn_facts.py +++ /dev/null @@ -1 +0,0 @@ -ec2_vpc_vpn_info.py \ No newline at end of file diff --git a/plugins/modules/ec2_vpc_vpn_info.py b/plugins/modules/ec2_vpc_vpn_info.py index 31fe02621b4..57ebb17e852 100644 --- a/plugins/modules/ec2_vpc_vpn_info.py +++ b/plugins/modules/ec2_vpc_vpn_info.py @@ -13,7 +13,6 @@ short_description: Gather information about VPN Connections in AWS. description: - Gather information about VPN Connections in AWS. - - This module was called C(ec2_vpc_vpn_facts) before Ansible 2.9. The usage did not change. author: Madhura Naniwadekar (@Madhura-CSI) options: filters: @@ -204,8 +203,6 @@ def main(): module = AnsibleAWSModule(argument_spec=argument_spec, mutually_exclusive=[['vpn_connection_ids', 'filters']], supports_check_mode=True) - if module._module._name == 'ec2_vpc_vpn_facts': - module._module.deprecate("The 'ec2_vpc_vpn_facts' module has been renamed to 'ec2_vpc_vpn_info'", date='2021-12-01', collection_name='community.aws') connection = module.client('ec2') diff --git a/plugins/modules/ecs_service_facts.py b/plugins/modules/ecs_service_facts.py deleted file mode 120000 index fead2dab76b..00000000000 --- a/plugins/modules/ecs_service_facts.py +++ /dev/null @@ -1 +0,0 @@ -ecs_service_info.py \ No newline at end of file diff --git a/plugins/modules/ecs_service_info.py b/plugins/modules/ecs_service_info.py index 79332e55702..e6167afd09c 100644 --- a/plugins/modules/ecs_service_info.py +++ b/plugins/modules/ecs_service_info.py @@ -13,8 +13,6 @@ short_description: List or describe services in ECS description: - Lists or describes services in ECS. - - This module was called C(ecs_service_facts) before Ansible 2.9, returning C(ansible_facts). - Note that the M(community.aws.ecs_service_info) module no longer returns C(ansible_facts)! author: - "Mark Chance (@Java1Guy)" - "Darek Kaczynski (@kaczynskid)" @@ -220,10 +218,6 @@ def main(): ) module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) - is_old_facts = module._name == 'ecs_service_facts' - if is_old_facts: - module.deprecate("The 'ecs_service_facts' module has been renamed to 'ecs_service_info', " - "and the renamed one no longer returns ansible_facts", date='2021-12-01', collection_name='community.aws') show_details = module.params.get('details') @@ -241,10 +235,7 @@ def main(): else: ecs_info = task_mgr.list_services(module.params['cluster']) - if is_old_facts: - module.exit_json(changed=False, ansible_facts=ecs_info, **ecs_info) - else: - module.exit_json(changed=False, **ecs_info) + module.exit_json(changed=False, **ecs_info) if __name__ == '__main__': diff --git a/plugins/modules/ecs_taskdefinition_facts.py b/plugins/modules/ecs_taskdefinition_facts.py deleted file mode 120000 index 0eb6f10b8ff..00000000000 --- a/plugins/modules/ecs_taskdefinition_facts.py +++ /dev/null @@ -1 +0,0 @@ -ecs_taskdefinition_info.py \ No newline at end of file diff --git a/plugins/modules/ecs_taskdefinition_info.py b/plugins/modules/ecs_taskdefinition_info.py index ad351576dca..b3772a7f7e3 100644 --- a/plugins/modules/ecs_taskdefinition_info.py +++ b/plugins/modules/ecs_taskdefinition_info.py @@ -14,7 +14,6 @@ notes: - For details of the parameters and returns see U(http://boto3.readthedocs.io/en/latest/reference/services/ecs.html#ECS.Client.describe_task_definition) - - This module was called C(ecs_taskdefinition_facts) before Ansible 2.9. The usage did not change. description: - Describes a task definition in ECS. author: @@ -313,9 +312,6 @@ def main(): ) module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) - if module._name == 'ecs_taskdefinition_facts': - module.deprecate("The 'ecs_taskdefinition_facts' module has been renamed to 'ecs_taskdefinition_info'", - date='2021-12-01', collection_name='community.aws') ecs = module.client('ecs') diff --git a/plugins/modules/efs_facts.py b/plugins/modules/efs_facts.py deleted file mode 120000 index 781c362da4b..00000000000 --- a/plugins/modules/efs_facts.py +++ /dev/null @@ -1 +0,0 @@ -efs_info.py \ No newline at end of file diff --git a/plugins/modules/efs_info.py b/plugins/modules/efs_info.py index 9a6ce1786fc..8f616d15dda 100644 --- a/plugins/modules/efs_info.py +++ b/plugins/modules/efs_info.py @@ -13,7 +13,6 @@ short_description: Get information about Amazon EFS file systems description: - This module can be used to search Amazon EFS file systems. - - This module was called C(efs_facts) before Ansible 2.9, returning C(ansible_facts). Note that the M(community.aws.efs_info) module no longer returns C(ansible_facts)! author: - "Ryan Sydnor (@ryansydnor)" @@ -363,10 +362,6 @@ def main(): module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) - is_old_facts = module._name == 'efs_facts' - if is_old_facts: - module.deprecate("The 'efs_facts' module has been renamed to 'efs_info', " - "and the renamed one no longer returns ansible_facts", date='2021-12-01', collection_name='community.aws') connection = EFSConnection(module) @@ -387,10 +382,7 @@ def main(): targets = [(item, prefix_to_attr(item)) for item in targets] file_systems_info = [item for item in file_systems_info if has_targets(item['mount_targets'], targets)] - if is_old_facts: - module.exit_json(changed=False, ansible_facts={'efs': file_systems_info}) - else: - module.exit_json(changed=False, efs=file_systems_info) + module.exit_json(changed=False, efs=file_systems_info) if __name__ == '__main__': diff --git a/plugins/modules/elasticache_facts.py b/plugins/modules/elasticache_facts.py deleted file mode 120000 index d6cd32eb0c5..00000000000 --- a/plugins/modules/elasticache_facts.py +++ /dev/null @@ -1 +0,0 @@ -elasticache_info.py \ No newline at end of file diff --git a/plugins/modules/elasticache_info.py b/plugins/modules/elasticache_info.py index 026337e3350..c9fa9cc4502 100644 --- a/plugins/modules/elasticache_info.py +++ b/plugins/modules/elasticache_info.py @@ -12,7 +12,6 @@ version_added: 1.0.0 description: - Retrieve information from AWS ElastiCache clusters - - This module was called C(elasticache_facts) before Ansible 2.9. The usage did not change. options: name: description: @@ -294,8 +293,6 @@ def main(): name=dict(required=False), ) module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) - if module._name == 'elasticache_facts': - module.deprecate("The 'elasticache_facts' module has been renamed to 'elasticache_info'", date='2021-12-01', collection_name='community.aws') client = module.client('elasticache') diff --git a/plugins/modules/elb_application_lb_facts.py b/plugins/modules/elb_application_lb_facts.py deleted file mode 120000 index c5ee0eaca83..00000000000 --- a/plugins/modules/elb_application_lb_facts.py +++ /dev/null @@ -1 +0,0 @@ -elb_application_lb_info.py \ No newline at end of file diff --git a/plugins/modules/elb_application_lb_info.py b/plugins/modules/elb_application_lb_info.py index d04bd0d8261..ddac4fe9629 100644 --- a/plugins/modules/elb_application_lb_info.py +++ b/plugins/modules/elb_application_lb_info.py @@ -13,7 +13,6 @@ short_description: Gather information about application ELBs in AWS description: - Gather information about application ELBs in AWS - - This module was called C(elb_application_lb_facts) before Ansible 2.9. The usage did not change. author: Rob White (@wimnat) options: load_balancer_arns: @@ -254,9 +253,6 @@ def main(): mutually_exclusive=[['load_balancer_arns', 'names']], supports_check_mode=True, ) - if module._name == 'elb_application_lb_facts': - module.deprecate("The 'elb_application_lb_facts' module has been renamed to 'elb_application_lb_info'", - date='2021-12-01', collection_name='community.aws') try: connection = module.client('elbv2') diff --git a/plugins/modules/elb_classic_lb_facts.py b/plugins/modules/elb_classic_lb_facts.py deleted file mode 120000 index d182d5e1441..00000000000 --- a/plugins/modules/elb_classic_lb_facts.py +++ /dev/null @@ -1 +0,0 @@ -elb_classic_lb_info.py \ No newline at end of file diff --git a/plugins/modules/elb_classic_lb_info.py b/plugins/modules/elb_classic_lb_info.py index 1afbd49c9dc..25d4eadbf63 100644 --- a/plugins/modules/elb_classic_lb_info.py +++ b/plugins/modules/elb_classic_lb_info.py @@ -24,7 +24,6 @@ short_description: Gather information about EC2 Elastic Load Balancers in AWS description: - Gather information about EC2 Elastic Load Balancers in AWS - - This module was called C(elb_classic_lb_facts) before Ansible 2.9. The usage did not change. author: - "Michael Schultz (@mjschultz)" - "Fernando Jose Pando (@nand0p)" @@ -218,8 +217,6 @@ def main(): ) module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) - if module._name == 'elb_classic_lb_facts': - module.deprecate("The 'elb_classic_lb_facts' module has been renamed to 'elb_classic_lb_info'", date='2021-12-01', collection_name='community.aws') connection = module.client('elb', retry_decorator=AWSRetry.jittered_backoff(retries=MAX_AWS_RETRIES, delay=MAX_AWS_DELAY)) diff --git a/plugins/modules/elb_target_facts.py b/plugins/modules/elb_target_facts.py deleted file mode 120000 index 897c23897de..00000000000 --- a/plugins/modules/elb_target_facts.py +++ /dev/null @@ -1 +0,0 @@ -elb_target_info.py \ No newline at end of file diff --git a/plugins/modules/elb_target_group_facts.py b/plugins/modules/elb_target_group_facts.py deleted file mode 120000 index 3abd2ee5a65..00000000000 --- a/plugins/modules/elb_target_group_facts.py +++ /dev/null @@ -1 +0,0 @@ -elb_target_group_info.py \ No newline at end of file diff --git a/plugins/modules/elb_target_group_info.py b/plugins/modules/elb_target_group_info.py index 59bfbbc66ff..5abe8d34210 100644 --- a/plugins/modules/elb_target_group_info.py +++ b/plugins/modules/elb_target_group_info.py @@ -13,7 +13,6 @@ short_description: Gather information about ELB target groups in AWS description: - Gather information about ELB target groups in AWS - - This module was called C(elb_target_group_facts) before Ansible 2.9. The usage did not change. author: Rob White (@wimnat) options: load_balancer_arn: @@ -299,8 +298,6 @@ def main(): mutually_exclusive=[['load_balancer_arn', 'target_group_arns', 'names']], supports_check_mode=True, ) - if module._name == 'elb_target_group_facts': - module.deprecate("The 'elb_target_group_facts' module has been renamed to 'elb_target_group_info'", date='2021-12-01', collection_name='community.aws') try: connection = module.client('elbv2') diff --git a/plugins/modules/elb_target_info.py b/plugins/modules/elb_target_info.py index 507380c9717..dc71adbc72f 100644 --- a/plugins/modules/elb_target_info.py +++ b/plugins/modules/elb_target_info.py @@ -12,7 +12,6 @@ description: - This module will search through every target group in a region to find which ones have registered a given instance ID or IP. - - This module was called C(elb_target_facts) before Ansible 2.9. The usage did not change. author: "Yaakov Kuperman (@yaakov-github)" options: @@ -412,8 +411,6 @@ def main(): argument_spec=argument_spec, supports_check_mode=True, ) - if module._name == 'elb_target_facts': - module.deprecate("The 'elb_target_facts' module has been renamed to 'elb_target_info'", date='2021-12-01', collection_name='community.aws') instance_id = module.params["instance_id"] get_unused_target_groups = module.params["get_unused_target_groups"] diff --git a/plugins/modules/iam_cert_facts.py b/plugins/modules/iam_cert_facts.py deleted file mode 120000 index 63244caa58d..00000000000 --- a/plugins/modules/iam_cert_facts.py +++ /dev/null @@ -1 +0,0 @@ -iam_server_certificate_info.py \ No newline at end of file diff --git a/plugins/modules/iam_mfa_device_facts.py b/plugins/modules/iam_mfa_device_facts.py deleted file mode 120000 index 63be2b059fd..00000000000 --- a/plugins/modules/iam_mfa_device_facts.py +++ /dev/null @@ -1 +0,0 @@ -iam_mfa_device_info.py \ No newline at end of file diff --git a/plugins/modules/iam_mfa_device_info.py b/plugins/modules/iam_mfa_device_info.py index 78cfe8249d0..4cd27875273 100644 --- a/plugins/modules/iam_mfa_device_info.py +++ b/plugins/modules/iam_mfa_device_info.py @@ -13,7 +13,6 @@ short_description: List the MFA (Multi-Factor Authentication) devices registered for a user description: - List the MFA (Multi-Factor Authentication) devices registered for a user - - This module was called C(iam_mfa_device_facts) before Ansible 2.9. The usage did not change. author: Victor Costan (@pwnall) options: user_name: @@ -91,8 +90,6 @@ def main(): 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') try: connection = module.client('iam') diff --git a/plugins/modules/iam_role_facts.py b/plugins/modules/iam_role_facts.py deleted file mode 120000 index e15c454b71c..00000000000 --- a/plugins/modules/iam_role_facts.py +++ /dev/null @@ -1 +0,0 @@ -iam_role_info.py \ No newline at end of file diff --git a/plugins/modules/iam_role_info.py b/plugins/modules/iam_role_info.py index a08df455fad..561b9f92d70 100644 --- a/plugins/modules/iam_role_info.py +++ b/plugins/modules/iam_role_info.py @@ -13,7 +13,6 @@ short_description: Gather information on IAM roles description: - Gathers information about IAM roles. - - This module was called C(iam_role_facts) before Ansible 2.9. The usage did not change. author: - "Will Thames (@willthames)" options: @@ -242,8 +241,6 @@ def main(): module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True, mutually_exclusive=[['name', 'path_prefix']]) - if module._name == 'iam_role_facts': - module.deprecate("The 'iam_role_facts' module has been renamed to 'iam_role_info'", date='2021-12-01', collection_name='community.aws') client = module.client('iam', retry_decorator=AWSRetry.jittered_backoff()) diff --git a/plugins/modules/iam_server_certificate_facts.py b/plugins/modules/iam_server_certificate_facts.py deleted file mode 120000 index 63244caa58d..00000000000 --- a/plugins/modules/iam_server_certificate_facts.py +++ /dev/null @@ -1 +0,0 @@ -iam_server_certificate_info.py \ No newline at end of file diff --git a/plugins/modules/iam_server_certificate_info.py b/plugins/modules/iam_server_certificate_info.py index a37c9e88c83..1356a5ec15e 100644 --- a/plugins/modules/iam_server_certificate_info.py +++ b/plugins/modules/iam_server_certificate_info.py @@ -13,7 +13,6 @@ short_description: Retrieve the information of a server certificate description: - Retrieve the attributes of a server certificate. - - This module was called C(iam_server_certificate_facts) before Ansible 2.9. The usage did not change. author: "Allen Sanabria (@linuxdynasty)" options: name: @@ -147,10 +146,6 @@ def main(): 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') - try: iam = module.client('iam') except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: diff --git a/plugins/modules/iam_user_info.py b/plugins/modules/iam_user_info.py index 10a6f2bffdc..e8fa1ac028a 100644 --- a/plugins/modules/iam_user_info.py +++ b/plugins/modules/iam_user_info.py @@ -45,17 +45,17 @@ EXAMPLES = r''' # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather facts about "test" user. -- name: Get IAM user facts +- name: Get IAM user info community.aws.iam_user_info: name: "test" # Gather facts about all users in the "dev" group. -- name: Get IAM user facts +- name: Get IAM user info community.aws.iam_user_info: group: "dev" # Gather facts about all users with "/division_abc/subdivision_xyz/" path. -- name: Get IAM user facts +- name: Get IAM user info community.aws.iam_user_info: path: "/division_abc/subdivision_xyz/" ''' diff --git a/plugins/modules/lambda_facts.py b/plugins/modules/lambda_facts.py deleted file mode 100644 index 010add7985d..00000000000 --- a/plugins/modules/lambda_facts.py +++ /dev/null @@ -1,382 +0,0 @@ -#!/usr/bin/python -# This file is part of Ansible -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -from __future__ import absolute_import, division, print_function -__metaclass__ = type - - -DOCUMENTATION = ''' ---- -module: lambda_facts -version_added: 1.0.0 -deprecated: - removed_at_date: '2021-12-01' - removed_from_collection: 'community.aws' - why: Deprecated in favour of C(_info) module. - alternative: Use M(community.aws.lambda_info) instead. -short_description: Gathers AWS Lambda function details as Ansible facts -description: - - Gathers various details related to Lambda functions, including aliases, versions and event source mappings. - Use module M(community.aws.lambda) to manage the lambda function itself, M(community.aws.lambda_alias) to manage function aliases and - M(community.aws.lambda_event) to manage lambda event source mappings. - - -options: - query: - description: - - Specifies the resource type for which to gather facts. Leave blank to retrieve all facts. - choices: [ "aliases", "all", "config", "mappings", "policy", "versions" ] - default: "all" - type: str - function_name: - description: - - The name of the lambda function for which facts are requested. - aliases: [ "function", "name"] - type: str - event_source_arn: - description: - - For query type 'mappings', this is the Amazon Resource Name (ARN) of the Amazon Kinesis or DynamoDB stream. - type: str -author: Pierre Jodouin (@pjodouin) -extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 - -''' - -EXAMPLES = ''' ---- -# Simple example of listing all info for a function -- name: List all for a specific function - community.aws.lambda_facts: - query: all - function_name: myFunction - register: my_function_details - -# List all versions of a function -- name: List function versions - community.aws.lambda_facts: - query: versions - function_name: myFunction - register: my_function_versions - -# List all lambda function versions -- name: List all function - community.aws.lambda_facts: - query: all - max_items: 20 -- name: show Lambda facts - ansible.builtin.debug: - var: lambda_facts -''' - -RETURN = ''' ---- -lambda_facts: - description: lambda facts - returned: success - type: dict -lambda_facts.function: - description: lambda function list - returned: success - type: dict -lambda_facts.function.TheName: - description: lambda function information, including event, mapping, and version information - returned: success - type: dict -''' -import json -import datetime -import sys -import re - -try: - import botocore -except ImportError: - pass # caught by AnsibleAWSModule - -from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict - -from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule -from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_code - - -def fix_return(node): - """ - fixup returned dictionary - - :param node: - :return: - """ - - if isinstance(node, datetime.datetime): - node_value = str(node) - - elif isinstance(node, list): - node_value = [fix_return(item) for item in node] - - elif isinstance(node, dict): - node_value = dict([(item, fix_return(node[item])) for item in node.keys()]) - - else: - node_value = node - - return node_value - - -def alias_details(client, module): - """ - Returns list of aliases for a specified function. - - :param client: AWS API client reference (boto3) - :param module: Ansible module reference - :return dict: - """ - - lambda_facts = dict() - - function_name = module.params.get('function_name') - if function_name: - params = dict() - if module.params.get('max_items'): - params['MaxItems'] = module.params.get('max_items') - - if module.params.get('next_marker'): - params['Marker'] = module.params.get('next_marker') - try: - lambda_facts.update(aliases=client.list_aliases(FunctionName=function_name, **params)['Aliases']) - except is_boto3_error_code('ResourceNotFoundException'): - lambda_facts.update(aliases=[]) - except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: # pylint: disable=duplicate-except - module.fail_json_aws(e, msg="Trying to get aliases") - else: - module.fail_json(msg='Parameter function_name required for query=aliases.') - - return {function_name: camel_dict_to_snake_dict(lambda_facts)} - - -def all_details(client, module): - """ - Returns all lambda related facts. - - :param client: AWS API client reference (boto3) - :param module: Ansible module reference - :return dict: - """ - - if module.params.get('max_items') or module.params.get('next_marker'): - module.fail_json(msg='Cannot specify max_items nor next_marker for query=all.') - - lambda_facts = dict() - - function_name = module.params.get('function_name') - if function_name: - lambda_facts[function_name] = {} - lambda_facts[function_name].update(config_details(client, module)[function_name]) - lambda_facts[function_name].update(alias_details(client, module)[function_name]) - lambda_facts[function_name].update(policy_details(client, module)[function_name]) - lambda_facts[function_name].update(version_details(client, module)[function_name]) - lambda_facts[function_name].update(mapping_details(client, module)[function_name]) - else: - lambda_facts.update(config_details(client, module)) - - return lambda_facts - - -def config_details(client, module): - """ - Returns configuration details for one or all lambda functions. - - :param client: AWS API client reference (boto3) - :param module: Ansible module reference - :return dict: - """ - - lambda_facts = dict() - - function_name = module.params.get('function_name') - if function_name: - try: - lambda_facts.update(client.get_function_configuration(FunctionName=function_name)) - except is_boto3_error_code('ResourceNotFoundException'): - lambda_facts.update(function={}) - except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: # pylint: disable=duplicate-except - module.fail_json_aws(e, msg="Trying to get {0} configuration".format(function_name)) - else: - params = dict() - if module.params.get('max_items'): - params['MaxItems'] = module.params.get('max_items') - - if module.params.get('next_marker'): - params['Marker'] = module.params.get('next_marker') - - try: - lambda_facts.update(function_list=client.list_functions(**params)['Functions']) - except is_boto3_error_code('ResourceNotFoundException'): - lambda_facts.update(function_list=[]) - except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: # pylint: disable=duplicate-except - module.fail_json_aws(e, msg="Trying to get function list") - - functions = dict() - for func in lambda_facts.pop('function_list', []): - functions[func['FunctionName']] = camel_dict_to_snake_dict(func) - return functions - - return {function_name: camel_dict_to_snake_dict(lambda_facts)} - - -def mapping_details(client, module): - """ - Returns all lambda event source mappings. - - :param client: AWS API client reference (boto3) - :param module: Ansible module reference - :return dict: - """ - - lambda_facts = dict() - params = dict() - function_name = module.params.get('function_name') - - if function_name: - params['FunctionName'] = module.params.get('function_name') - - if module.params.get('event_source_arn'): - params['EventSourceArn'] = module.params.get('event_source_arn') - - if module.params.get('max_items'): - params['MaxItems'] = module.params.get('max_items') - - if module.params.get('next_marker'): - params['Marker'] = module.params.get('next_marker') - - try: - lambda_facts.update(mappings=client.list_event_source_mappings(**params)['EventSourceMappings']) - except is_boto3_error_code('ResourceNotFoundException'): - lambda_facts.update(mappings=[]) - except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: # pylint: disable=duplicate-except - module.fail_json_aws(e, msg="Trying to get source event mappings") - - if function_name: - return {function_name: camel_dict_to_snake_dict(lambda_facts)} - - return camel_dict_to_snake_dict(lambda_facts) - - -def policy_details(client, module): - """ - Returns policy attached to a lambda function. - - :param client: AWS API client reference (boto3) - :param module: Ansible module reference - :return dict: - """ - - if module.params.get('max_items') or module.params.get('next_marker'): - module.fail_json(msg='Cannot specify max_items nor next_marker for query=policy.') - - lambda_facts = dict() - - function_name = module.params.get('function_name') - if function_name: - try: - # get_policy returns a JSON string so must convert to dict before reassigning to its key - lambda_facts.update(policy=json.loads(client.get_policy(FunctionName=function_name)['Policy'])) - except is_boto3_error_code('ResourceNotFoundException'): - lambda_facts.update(policy={}) - except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: # pylint: disable=duplicate-except - module.fail_json_aws(e, msg="Trying to get {0} policy".format(function_name)) - else: - module.fail_json(msg='Parameter function_name required for query=policy.') - - return {function_name: camel_dict_to_snake_dict(lambda_facts)} - - -def version_details(client, module): - """ - Returns all lambda function versions. - - :param client: AWS API client reference (boto3) - :param module: Ansible module reference - :return dict: - """ - - lambda_facts = dict() - - function_name = module.params.get('function_name') - if function_name: - params = dict() - if module.params.get('max_items'): - params['MaxItems'] = module.params.get('max_items') - - if module.params.get('next_marker'): - params['Marker'] = module.params.get('next_marker') - - try: - lambda_facts.update(versions=client.list_versions_by_function(FunctionName=function_name, **params)['Versions']) - except is_boto3_error_code('ResourceNotFoundException'): - lambda_facts.update(versions=[]) - except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: # pylint: disable=duplicate-except - module.fail_json_aws(e, msg="Trying to get {0} versions".format(function_name)) - else: - module.fail_json(msg='Parameter function_name required for query=versions.') - - return {function_name: camel_dict_to_snake_dict(lambda_facts)} - - -def main(): - """ - Main entry point. - - :return dict: ansible facts - """ - argument_spec = dict( - function_name=dict(required=False, default=None, aliases=['function', 'name']), - query=dict(required=False, choices=['aliases', 'all', 'config', 'mappings', 'policy', 'versions'], default='all'), - event_source_arn=dict(required=False, default=None) - ) - - module = AnsibleAWSModule( - argument_spec=argument_spec, - supports_check_mode=True, - mutually_exclusive=[], - required_together=[] - ) - - # validate function_name if present - function_name = module.params['function_name'] - if function_name: - if not re.search(r"^[\w\-:]+$", function_name): - module.fail_json( - msg='Function name {0} is invalid. Names must contain only alphanumeric characters and hyphens.'.format(function_name) - ) - if len(function_name) > 64: - module.fail_json(msg='Function name "{0}" exceeds 64 character limit'.format(function_name)) - - client = module.client('lambda') - - this_module = sys.modules[__name__] - - invocations = dict( - aliases='alias_details', - all='all_details', - config='config_details', - mappings='mapping_details', - policy='policy_details', - versions='version_details', - ) - - this_module_function = getattr(this_module, invocations[module.params['query']]) - all_facts = fix_return(this_module_function(client, module)) - - results = dict(ansible_facts={'lambda_facts': {'function': all_facts}}, changed=False) - - if module.check_mode: - results['msg'] = 'Check mode set but ignored for fact gathering only.' - - module.exit_json(**results) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/rds_instance_facts.py b/plugins/modules/rds_instance_facts.py deleted file mode 120000 index f3dda867271..00000000000 --- a/plugins/modules/rds_instance_facts.py +++ /dev/null @@ -1 +0,0 @@ -rds_instance_info.py \ No newline at end of file diff --git a/plugins/modules/rds_instance_info.py b/plugins/modules/rds_instance_info.py index 13609972c17..22a10a081ed 100644 --- a/plugins/modules/rds_instance_info.py +++ b/plugins/modules/rds_instance_info.py @@ -15,7 +15,6 @@ short_description: obtain information about one or more RDS instances description: - Obtain information about one or more RDS instances. - - This module was called C(rds_instance_facts) before Ansible 2.9. The usage did not change. options: db_instance_identifier: description: @@ -398,8 +397,6 @@ def main(): argument_spec=argument_spec, supports_check_mode=True, ) - if module._name == 'rds_instance_facts': - module.deprecate("The 'rds_instance_facts' module has been renamed to 'rds_instance_info'", date='2021-12-01', collection_name='community.aws') conn = module.client('rds', retry_decorator=AWSRetry.jittered_backoff(retries=10)) diff --git a/plugins/modules/rds_snapshot_facts.py b/plugins/modules/rds_snapshot_facts.py deleted file mode 120000 index 7281d3b696f..00000000000 --- a/plugins/modules/rds_snapshot_facts.py +++ /dev/null @@ -1 +0,0 @@ -rds_snapshot_info.py \ No newline at end of file diff --git a/plugins/modules/rds_snapshot_info.py b/plugins/modules/rds_snapshot_info.py index d374520ab89..7abc0cae675 100644 --- a/plugins/modules/rds_snapshot_info.py +++ b/plugins/modules/rds_snapshot_info.py @@ -16,7 +16,6 @@ description: - Obtain information about one or more RDS snapshots. These can be for unclustered snapshots or snapshots of clustered DBs (Aurora). - Aurora snapshot information may be obtained if no identifier parameters are passed or if one of the cluster parameters are passed. - - This module was called C(rds_snapshot_facts) before Ansible 2.9. The usage did not change. options: db_snapshot_identifier: description: @@ -373,8 +372,6 @@ def main(): supports_check_mode=True, mutually_exclusive=[['db_snapshot_identifier', 'db_instance_identifier', 'db_cluster_identifier', 'db_cluster_snapshot_identifier']] ) - if module._name == 'rds_snapshot_facts': - module.deprecate("The 'rds_snapshot_facts' module has been renamed to 'rds_snapshot_info'", date='2021-12-01', collection_name='community.aws') conn = module.client('rds', retry_decorator=AWSRetry.jittered_backoff(retries=10)) results = dict() diff --git a/plugins/modules/redshift_facts.py b/plugins/modules/redshift_facts.py deleted file mode 120000 index 40a774faad8..00000000000 --- a/plugins/modules/redshift_facts.py +++ /dev/null @@ -1 +0,0 @@ -redshift_info.py \ No newline at end of file diff --git a/plugins/modules/redshift_info.py b/plugins/modules/redshift_info.py index bc4cb021840..b79b28b3074 100644 --- a/plugins/modules/redshift_info.py +++ b/plugins/modules/redshift_info.py @@ -15,7 +15,6 @@ short_description: Gather information about Redshift cluster(s) description: - Gather information about Redshift cluster(s). - - This module was called C(redshift_facts) before Ansible 2.9. The usage did not change. options: cluster_identifier: description: @@ -334,8 +333,6 @@ def main(): argument_spec=argument_spec, supports_check_mode=True ) - if module._name == 'redshift_facts': - module.deprecate("The 'redshift_facts' module has been renamed to 'redshift_info'", date='2021-12-01', collection_name='community.aws') cluster_identifier = module.params.get('cluster_identifier') cluster_tags = module.params.get('tags') diff --git a/plugins/modules/route53_facts.py b/plugins/modules/route53_facts.py deleted file mode 120000 index 6b40f0529b0..00000000000 --- a/plugins/modules/route53_facts.py +++ /dev/null @@ -1 +0,0 @@ -route53_info.py \ No newline at end of file diff --git a/plugins/modules/route53_info.py b/plugins/modules/route53_info.py index 322ce7b0523..e2f1cd686ff 100644 --- a/plugins/modules/route53_info.py +++ b/plugins/modules/route53_info.py @@ -12,7 +12,6 @@ version_added: 1.0.0 description: - Gets various details related to Route53 zone, record set or health check details. - - This module was called C(route53_facts) before Ansible 2.9. The usage did not change. options: query: description: @@ -474,8 +473,6 @@ def main(): ], check_boto3=False, ) - if module._name == 'route53_facts': - module.deprecate("The 'route53_facts' module has been renamed to 'route53_info'", date='2021-12-01', collection_name='community.aws') try: route53 = module.client('route53') diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 16062bb5c52..e910dea6a74 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -1,46 +1,9 @@ -plugins/modules/aws_acm_info.py pylint:ansible-deprecated-no-version plugins/modules/aws_kms.py pylint:ansible-deprecated-no-version -plugins/modules/aws_kms_info.py pylint:ansible-deprecated-no-version -plugins/modules/aws_region_info.py pylint:ansible-deprecated-no-version -plugins/modules/aws_s3_bucket_info.py pylint:ansible-deprecated-no-version -plugins/modules/aws_sgw_info.py pylint:ansible-deprecated-no-version -plugins/modules/aws_waf_info.py pylint:ansible-deprecated-no-version -plugins/modules/cloudfront_info.py pylint:ansible-deprecated-no-version -plugins/modules/cloudwatchlogs_log_group_info.py pylint:ansible-deprecated-no-version -plugins/modules/ec2_asg_info.py pylint:ansible-deprecated-no-version -plugins/modules/ec2_customer_gateway_info.py pylint:ansible-deprecated-no-version -plugins/modules/ec2_eip_info.py pylint:ansible-deprecated-no-version -plugins/modules/ec2_elb_info.py validate-modules:deprecation-mismatch # Ansible 2.9 docs don't support deprecation properly -plugins/modules/ec2_elb_info.py validate-modules:invalid-documentation # Ansible 2.9 docs don't support deprecation properly -plugins/modules/ec2_lc_info.py pylint:ansible-deprecated-no-version plugins/modules/ec2_metric_alarm.py pylint:ansible-deprecated-no-version -plugins/modules/ec2_placement_group_info.py pylint:ansible-deprecated-no-version -plugins/modules/ec2_vpc_nacl_info.py pylint:ansible-deprecated-no-version -plugins/modules/ec2_vpc_peering_info.py pylint:ansible-deprecated-no-version -plugins/modules/ec2_vpc_route_table_info.py pylint:ansible-deprecated-no-version -plugins/modules/ec2_vpc_vgw_info.py pylint:ansible-deprecated-no-version -plugins/modules/ec2_vpc_vpn_info.py pylint:ansible-deprecated-no-version -plugins/modules/ecs_service_info.py pylint:ansible-deprecated-no-version -plugins/modules/ecs_taskdefinition_info.py pylint:ansible-deprecated-no-version -plugins/modules/efs_info.py pylint:ansible-deprecated-no-version -plugins/modules/elasticache_info.py pylint:ansible-deprecated-no-version -plugins/modules/elb_application_lb_info.py pylint:ansible-deprecated-no-version -plugins/modules/elb_classic_lb_info.py pylint:ansible-deprecated-no-version plugins/modules/elb_network_lb.py pylint:ansible-deprecated-no-version -plugins/modules/elb_target_group_info.py pylint:ansible-deprecated-no-version -plugins/modules/elb_target_info.py pylint:ansible-deprecated-no-version plugins/modules/iam.py validate-modules:deprecation-mismatch # Ansible 2.9 docs don't support deprecation properly plugins/modules/iam.py validate-modules:invalid-documentation # Ansible 2.9 docs don't support deprecation properly -plugins/modules/iam_mfa_device_info.py pylint:ansible-deprecated-no-version plugins/modules/iam_policy.py pylint:ansible-deprecated-no-version plugins/modules/iam_role.py pylint:ansible-deprecated-no-version -plugins/modules/iam_role_info.py pylint:ansible-deprecated-no-version -plugins/modules/iam_server_certificate_info.py pylint:ansible-deprecated-no-version -plugins/modules/lambda_facts.py validate-modules:deprecation-mismatch -plugins/modules/lambda_facts.py validate-modules:invalid-documentation plugins/modules/rds.py validate-modules:deprecation-mismatch # Ansible 2.9 docs don't support deprecation properly plugins/modules/rds.py validate-modules:invalid-documentation # Ansible 2.9 docs don't support deprecation properly -plugins/modules/rds_instance_info.py pylint:ansible-deprecated-no-version -plugins/modules/rds_snapshot_info.py pylint:ansible-deprecated-no-version -plugins/modules/redshift_info.py pylint:ansible-deprecated-no-version -plugins/modules/route53_info.py pylint:ansible-deprecated-no-version