From fc4bbff6e17650439c595255f7a692d587c4a42d Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 10 Jun 2019 17:48:07 +0200 Subject: [PATCH] AWS: _facts -> _info (part 2) (#57626) * Rename cloudwatchlogs_log_group_facts -> cloudwatchlogs_log_group_info. * Rename elasticache_facts -> elasticache_info. * redshift_facts -> redshift_info. * Rename route53_facts -> route53_info. * Rename rds_instance_facts -> rds_instance_info. * Rename rds_snapshot_facts -> rds_snapshot_info. * Rename iam_mfa_device_facts -> iam_mfa_device_info. * Rename iam_role_facts -> iam_role_info. * Rename iam_server_certificate_facts -> iam_server_certificate_info. * Rename elb_application_lb_facts -> elb_application_lb_info. * Renaming elb_classic_lb_facts -> elb_classic_lb_info. * elb_target_facts -> elb_target_info. * Rename elb_target_group_facts -> elb_target_group_info. * Update porting guide. * Add changelog. * Fix module defaults (both for this PR and #57613). * Two fixes. --- .github/BOTMETA.yml | 2 +- .../fragments/57626-aws-facts-info.yaml | 14 +++++++ .../rst/porting_guides/porting_guide_2.9.rst | 13 ++++++ lib/ansible/config/module_defaults.yml | 40 +++++++++---------- .../amazon/_cloudwatchlogs_log_group_facts.py | 1 + .../cloud/amazon/_elasticache_facts.py | 1 + .../cloud/amazon/_elb_application_lb_facts.py | 1 + .../cloud/amazon/_elb_classic_lb_facts.py | 1 + .../modules/cloud/amazon/_elb_target_facts.py | 1 + .../cloud/amazon/_elb_target_group_facts.py | 1 + .../modules/cloud/amazon/_iam_cert_facts.py | 2 +- .../cloud/amazon/_iam_mfa_device_facts.py | 1 + .../modules/cloud/amazon/_iam_role_facts.py | 1 + .../amazon/_iam_server_certificate_facts.py | 1 + .../cloud/amazon/_rds_instance_facts.py | 1 + .../cloud/amazon/_rds_snapshot_facts.py | 1 + .../modules/cloud/amazon/_redshift_facts.py | 1 + .../modules/cloud/amazon/_route53_facts.py | 1 + ...ts.py => cloudwatchlogs_log_group_info.py} | 12 ++++-- ...asticache_facts.py => elasticache_info.py} | 17 ++++---- ...lb_facts.py => elb_application_lb_info.py} | 29 ++++++++------ ...sic_lb_facts.py => elb_classic_lb_info.py} | 37 +++++++++-------- ...roup_facts.py => elb_target_group_info.py} | 21 +++++----- ...elb_target_facts.py => elb_target_info.py} | 37 +++++++++-------- ...device_facts.py => iam_mfa_device_info.py} | 7 +++- .../{iam_role_facts.py => iam_role_info.py} | 11 +++-- ...acts.py => iam_server_certificate_info.py} | 11 +++-- ...instance_facts.py => rds_instance_info.py} | 21 +++++----- ...snapshot_facts.py => rds_snapshot_info.py} | 33 ++++++++------- .../{redshift_facts.py => redshift_info.py} | 17 ++++---- .../{route53_facts.py => route53_info.py} | 29 ++++++++------ .../targets/aws_secret/tasks/main.yaml | 10 ++--- .../aws_ses_rule_set/tasks/obtain-lock.yaml | 2 +- .../roles/ecs_cluster/tasks/main.yml | 2 +- .../aliases | 0 .../playbooks/full_test.yml | 2 +- .../roles/elb_target_facts/defaults/main.yml | 0 .../roles/elb_target_facts/tasks/main.yml | 20 +++++----- .../runme.sh | 0 .../tasks/test_final_snapshot.yml | 2 +- .../targets/route53/tasks/main.yml | 2 +- test/sanity/validate-modules/ignore.txt | 2 +- 42 files changed, 244 insertions(+), 164 deletions(-) create mode 100644 changelogs/fragments/57626-aws-facts-info.yaml create mode 120000 lib/ansible/modules/cloud/amazon/_cloudwatchlogs_log_group_facts.py create mode 120000 lib/ansible/modules/cloud/amazon/_elasticache_facts.py create mode 120000 lib/ansible/modules/cloud/amazon/_elb_application_lb_facts.py create mode 120000 lib/ansible/modules/cloud/amazon/_elb_classic_lb_facts.py create mode 120000 lib/ansible/modules/cloud/amazon/_elb_target_facts.py create mode 120000 lib/ansible/modules/cloud/amazon/_elb_target_group_facts.py create mode 120000 lib/ansible/modules/cloud/amazon/_iam_mfa_device_facts.py create mode 120000 lib/ansible/modules/cloud/amazon/_iam_role_facts.py create mode 120000 lib/ansible/modules/cloud/amazon/_iam_server_certificate_facts.py create mode 120000 lib/ansible/modules/cloud/amazon/_rds_instance_facts.py create mode 120000 lib/ansible/modules/cloud/amazon/_rds_snapshot_facts.py create mode 120000 lib/ansible/modules/cloud/amazon/_redshift_facts.py create mode 120000 lib/ansible/modules/cloud/amazon/_route53_facts.py rename lib/ansible/modules/cloud/amazon/{cloudwatchlogs_log_group_facts.py => cloudwatchlogs_log_group_info.py} (87%) rename lib/ansible/modules/cloud/amazon/{elasticache_facts.py => elasticache_info.py} (94%) rename lib/ansible/modules/cloud/amazon/{elb_application_lb_facts.py => elb_application_lb_info.py} (92%) rename lib/ansible/modules/cloud/amazon/{elb_classic_lb_facts.py => elb_classic_lb_info.py} (86%) rename lib/ansible/modules/cloud/amazon/{elb_target_group_facts.py => elb_target_group_info.py} (94%) rename lib/ansible/modules/cloud/amazon/{elb_target_facts.py => elb_target_info.py} (94%) rename lib/ansible/modules/cloud/amazon/{iam_mfa_device_facts.py => iam_mfa_device_info.py} (91%) rename lib/ansible/modules/cloud/amazon/{iam_role_facts.py => iam_role_info.py} (96%) rename lib/ansible/modules/cloud/amazon/{iam_server_certificate_facts.py => iam_server_certificate_info.py} (91%) rename lib/ansible/modules/cloud/amazon/{rds_instance_facts.py => rds_instance_info.py} (95%) rename lib/ansible/modules/cloud/amazon/{rds_snapshot_facts.py => rds_snapshot_info.py} (90%) rename lib/ansible/modules/cloud/amazon/{redshift_facts.py => redshift_info.py} (96%) rename lib/ansible/modules/cloud/amazon/{route53_facts.py => route53_info.py} (96%) rename test/integration/targets/{elb_target_facts => elb_target_info}/aliases (100%) rename test/integration/targets/{elb_target_facts => elb_target_info}/playbooks/full_test.yml (80%) rename test/integration/targets/{elb_target_facts => elb_target_info}/playbooks/roles/elb_target_facts/defaults/main.yml (100%) rename test/integration/targets/{elb_target_facts => elb_target_info}/playbooks/roles/elb_target_facts/tasks/main.yml (97%) rename test/integration/targets/{elb_target_facts => elb_target_info}/runme.sh (100%) diff --git a/.github/BOTMETA.yml b/.github/BOTMETA.yml index 3451bd093bc..0ef3c9316dc 100644 --- a/.github/BOTMETA.yml +++ b/.github/BOTMETA.yml @@ -87,7 +87,7 @@ files: $modules/cloud/amazon/ecs_taskdefinition.py: willthames $modules/cloud/amazon/ecs_taskdefinition_facts.py: willthames $modules/cloud/amazon/elasticache.py: alachaum - $modules/cloud/amazon/elb_target_group_facts.py: willthames + $modules/cloud/amazon/elb_target_group_info.py: willthames $modules/cloud/amazon/iam.py: $team_ansible $modules/cloud/amazon/iam_cert.py: $team_ansible $modules/cloud/amazon/iam_group.py: willthames diff --git a/changelogs/fragments/57626-aws-facts-info.yaml b/changelogs/fragments/57626-aws-facts-info.yaml new file mode 100644 index 00000000000..4bc4023e5b0 --- /dev/null +++ b/changelogs/fragments/57626-aws-facts-info.yaml @@ -0,0 +1,14 @@ +minor_changes: +- The ``cloudwatchlogs_log_group_facts`` module has been renamed to ``cloudwatchlogs_log_group_info``. +- The ``elasticache_facts`` module has been renamed to ``elasticache_info``. +- The ``elb_application_lb_facts`` module has been renamed to ``elb_application_lb_info``. +- The ``elb_classic_lb_facts`` module has been renamed to ``elb_classic_lb_info``. +- The ``elb_target_facts`` module has been renamed to ``elb_target_info``. +- The ``elb_target_group_facts`` module has been renamed to ``elb_target_group_info``. +- The ``iam_mfa_device_facts`` module has been renamed to ``iam_mfa_device_info``. +- The ``iam_role_facts`` module has been renamed to ``iam_role_info``. +- The ``iam_server_certificate_facts`` module has been renamed to ``iam_server_certificate_info``. +- The ``rds_instance_facts`` module has been renamed to ``rds_instance_info``. +- The ``rds_snapshot_facts`` module has been renamed to ``rds_snapshot_info``. +- The ``redshift_facts`` module has been renamed to ``redshift_info``. +- The ``route53_facts`` module has been renamed to ``route53_info``. diff --git a/docs/docsite/rst/porting_guides/porting_guide_2.9.rst b/docs/docsite/rst/porting_guides/porting_guide_2.9.rst index cc580e2b205..0244cebbcb6 100644 --- a/docs/docsite/rst/porting_guides/porting_guide_2.9.rst +++ b/docs/docsite/rst/porting_guides/porting_guide_2.9.rst @@ -102,6 +102,19 @@ Noteworthy module changes * The ``aws_region_facts`` module was renamed to :ref:`aws_region_info `. * The ``aws_sgw_facts`` module was renamed to :ref:`aws_sgw_info `. * The ``aws_waf_facts`` module was renamed to :ref:`aws_waf_info `. +* The ``cloudwatchlogs_log_group_facts`` module was renamed to :ref:`cloudwatchlogs_log_group_info `. +* The ``elasticache_facts`` module was renamed to :ref:`elasticache_info `. +* The ``elb_application_lb_facts`` module was renamed to :ref:`elb_application_lb_info `. +* The ``elb_classic_lb_facts`` module was renamed to :ref:`elb_classic_lb_info `. +* The ``elb_target_facts`` module was renamed to :ref:`elb_target_info `. +* The ``elb_target_group_facts`` module was renamed to :ref:`elb_target_group_info `. +* The ``iam_mfa_device_facts`` module was renamed to :ref:`iam_mfa_device_info `. +* The ``iam_role_facts`` module was renamed to :ref:`iam_role_info `. +* The ``iam_server_certificate_facts`` module was renamed to :ref:`iam_server_certificate_info `. +* The ``rds_instance_facts`` module was renamed to :ref:`rds_instance_info `. +* The ``rds_snapshot_facts`` module was renamed to :ref:`rds_snapshot_info `. +* The ``redshift_facts`` module was renamed to :ref:`redshift_info `. +* The ``route53_facts`` module was renamed to :ref:`route53_info `. Plugins diff --git a/lib/ansible/config/module_defaults.yml b/lib/ansible/config/module_defaults.yml index 6b62d93cd11..24f6065de8c 100644 --- a/lib/ansible/config/module_defaults.yml +++ b/lib/ansible/config/module_defaults.yml @@ -1,12 +1,12 @@ version: '1.0' groupings: - aws_acm_facts: + aws_acm_info: - aws aws_api_gateway: - aws aws_application_scaling_policy: - aws - aws_az_facts: + aws_az_info: - aws aws_batch_compute_environment: - aws @@ -14,7 +14,7 @@ groupings: - aws aws_batch_job_queue: - aws - aws_caller_facts: + aws_caller_info: - aws aws_config_aggregation_authorization: - aws @@ -46,9 +46,9 @@ groupings: - aws aws_kms: - aws - aws_kms_facts: + aws_kms_info: - aws - aws_region_facts: + aws_region_info: - aws aws_s3: - aws @@ -60,13 +60,13 @@ groupings: - aws aws_ses_identity_policy: - aws - aws_sgw_facts: + aws_sgw_info: - aws aws_ssm_parameter_store: - aws aws_waf_condition: - aws - aws_waf_facts: + aws_waf_info: - aws aws_waf_rule: - aws @@ -90,7 +90,7 @@ groupings: - aws cloudwatchlogs_log_group: - aws - cloudwatchlogs_log_group_facts: + cloudwatchlogs_log_group_info: - aws cpm_plugconfig: - cpm @@ -240,7 +240,7 @@ groupings: - aws ecs_taskdefinition: - aws - ecs_taskdefinition_facts: + ecs_taskdefinition_info: - aws efs: - aws @@ -248,7 +248,7 @@ groupings: - aws elasticache: - aws - elasticache_facts: + elasticache_info: - aws elasticache_parameter_group: - aws @@ -258,11 +258,11 @@ groupings: - aws elb_application_lb: - aws - elb_application_lb_facts: + elb_application_lb_info: - aws elb_classic_lb: - aws - elb_classic_lb_facts: + elb_classic_lb_info: - aws elb_instance: - aws @@ -272,7 +272,7 @@ groupings: - aws elb_target_group: - aws - elb_target_group_facts: + elb_target_group_info: - aws execute_lambda: - aws @@ -284,15 +284,15 @@ groupings: - aws iam_managed_policy: - aws - iam_mfa_device_facts: + iam_mfa_device_info: - aws iam_policy: - aws iam_role: - aws - iam_role_facts: + iam_role_info: - aws - iam_server_certificate_facts: + iam_server_certificate_info: - aws iam_user: - aws @@ -314,23 +314,23 @@ groupings: - aws rds_instance: - aws - rds_instance_facts: + rds_instance_info: - aws rds_param_group: - aws - rds_snapshot_facts: + rds_snapshot_info: - aws rds_subnet_group: - aws redshift: - aws - redshift_facts: + redshift_info: - aws redshift_subnet_group: - aws route53: - aws - route53_facts: + route53_info: - aws route53_health_check: - aws diff --git a/lib/ansible/modules/cloud/amazon/_cloudwatchlogs_log_group_facts.py b/lib/ansible/modules/cloud/amazon/_cloudwatchlogs_log_group_facts.py new file mode 120000 index 00000000000..402937478ad --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_cloudwatchlogs_log_group_facts.py @@ -0,0 +1 @@ +cloudwatchlogs_log_group_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/_elasticache_facts.py b/lib/ansible/modules/cloud/amazon/_elasticache_facts.py new file mode 120000 index 00000000000..d6cd32eb0c5 --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_elasticache_facts.py @@ -0,0 +1 @@ +elasticache_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/_elb_application_lb_facts.py b/lib/ansible/modules/cloud/amazon/_elb_application_lb_facts.py new file mode 120000 index 00000000000..c5ee0eaca83 --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_elb_application_lb_facts.py @@ -0,0 +1 @@ +elb_application_lb_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/_elb_classic_lb_facts.py b/lib/ansible/modules/cloud/amazon/_elb_classic_lb_facts.py new file mode 120000 index 00000000000..d182d5e1441 --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_elb_classic_lb_facts.py @@ -0,0 +1 @@ +elb_classic_lb_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/_elb_target_facts.py b/lib/ansible/modules/cloud/amazon/_elb_target_facts.py new file mode 120000 index 00000000000..897c23897de --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_elb_target_facts.py @@ -0,0 +1 @@ +elb_target_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/_elb_target_group_facts.py b/lib/ansible/modules/cloud/amazon/_elb_target_group_facts.py new file mode 120000 index 00000000000..3abd2ee5a65 --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_elb_target_group_facts.py @@ -0,0 +1 @@ +elb_target_group_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/_iam_cert_facts.py b/lib/ansible/modules/cloud/amazon/_iam_cert_facts.py index 3fe8cac3c8d..63244caa58d 120000 --- a/lib/ansible/modules/cloud/amazon/_iam_cert_facts.py +++ b/lib/ansible/modules/cloud/amazon/_iam_cert_facts.py @@ -1 +1 @@ -iam_server_certificate_facts.py \ No newline at end of file +iam_server_certificate_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/_iam_mfa_device_facts.py b/lib/ansible/modules/cloud/amazon/_iam_mfa_device_facts.py new file mode 120000 index 00000000000..63be2b059fd --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_iam_mfa_device_facts.py @@ -0,0 +1 @@ +iam_mfa_device_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/_iam_role_facts.py b/lib/ansible/modules/cloud/amazon/_iam_role_facts.py new file mode 120000 index 00000000000..e15c454b71c --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_iam_role_facts.py @@ -0,0 +1 @@ +iam_role_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/_iam_server_certificate_facts.py b/lib/ansible/modules/cloud/amazon/_iam_server_certificate_facts.py new file mode 120000 index 00000000000..63244caa58d --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_iam_server_certificate_facts.py @@ -0,0 +1 @@ +iam_server_certificate_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/_rds_instance_facts.py b/lib/ansible/modules/cloud/amazon/_rds_instance_facts.py new file mode 120000 index 00000000000..f3dda867271 --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_rds_instance_facts.py @@ -0,0 +1 @@ +rds_instance_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/_rds_snapshot_facts.py b/lib/ansible/modules/cloud/amazon/_rds_snapshot_facts.py new file mode 120000 index 00000000000..7281d3b696f --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_rds_snapshot_facts.py @@ -0,0 +1 @@ +rds_snapshot_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/_redshift_facts.py b/lib/ansible/modules/cloud/amazon/_redshift_facts.py new file mode 120000 index 00000000000..40a774faad8 --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_redshift_facts.py @@ -0,0 +1 @@ +redshift_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/_route53_facts.py b/lib/ansible/modules/cloud/amazon/_route53_facts.py new file mode 120000 index 00000000000..6b40f0529b0 --- /dev/null +++ b/lib/ansible/modules/cloud/amazon/_route53_facts.py @@ -0,0 +1 @@ +route53_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/amazon/cloudwatchlogs_log_group_facts.py b/lib/ansible/modules/cloud/amazon/cloudwatchlogs_log_group_info.py similarity index 87% rename from lib/ansible/modules/cloud/amazon/cloudwatchlogs_log_group_facts.py rename to lib/ansible/modules/cloud/amazon/cloudwatchlogs_log_group_info.py index a5c9dfb9314..e00f16b59fa 100644 --- a/lib/ansible/modules/cloud/amazon/cloudwatchlogs_log_group_facts.py +++ b/lib/ansible/modules/cloud/amazon/cloudwatchlogs_log_group_info.py @@ -12,9 +12,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: cloudwatchlogs_log_group_facts -short_description: get facts about log_group in CloudWatchLogs -description: Lists the specified log groups. You can list all your log groups or filter the results by prefix. +module: cloudwatchlogs_log_group_info +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. version_added: "2.5" author: - Willian Ricardo (@willricardo) @@ -30,7 +32,7 @@ extends_documentation_fragment: EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -- cloudwatchlogs_log_group_facts: +- cloudwatchlogs_log_group_info: log_group_name: test-log-group ''' @@ -103,6 +105,8 @@ def main(): )) module = AnsibleModule(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'", version='2.13') if not HAS_BOTO3: module.fail_json(msg='boto3 is required.') diff --git a/lib/ansible/modules/cloud/amazon/elasticache_facts.py b/lib/ansible/modules/cloud/amazon/elasticache_info.py similarity index 94% rename from lib/ansible/modules/cloud/amazon/elasticache_facts.py rename to lib/ansible/modules/cloud/amazon/elasticache_info.py index 389ee6e2226..cd60c8e8501 100644 --- a/lib/ansible/modules/cloud/amazon/elasticache_facts.py +++ b/lib/ansible/modules/cloud/amazon/elasticache_info.py @@ -7,10 +7,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', 'supported_by': 'community'} DOCUMENTATION = ''' -module: elasticache_facts -short_description: Retrieve facts for AWS Elasticache clusters +module: elasticache_info +short_description: Retrieve information for AWS Elasticache clusters description: - - Retrieve facts from AWS Elasticache clusters + - Retrieve information from AWS Elasticache clusters + - This module was called C(elasticache_facts) before Ansible 2.9. The usage did not change. version_added: "2.5" options: name: @@ -25,11 +26,11 @@ extends_documentation_fragment: ''' EXAMPLES = ''' -- name: obtain all Elasticache facts - elasticache_facts: +- name: obtain all Elasticache information + elasticache_info: -- name: obtain all facts for a single Elasticache cluster - elasticache_facts: +- name: obtain all information for a single Elasticache cluster + elasticache_info: name: test_elasticache ''' @@ -297,6 +298,8 @@ def main(): ) ) 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'", version='2.13') region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module, boto3=True) client = boto3_conn(module, conn_type='client', resource='elasticache', diff --git a/lib/ansible/modules/cloud/amazon/elb_application_lb_facts.py b/lib/ansible/modules/cloud/amazon/elb_application_lb_info.py similarity index 92% rename from lib/ansible/modules/cloud/amazon/elb_application_lb_facts.py rename to lib/ansible/modules/cloud/amazon/elb_application_lb_info.py index 38a90ff769c..6f168186391 100644 --- a/lib/ansible/modules/cloud/amazon/elb_application_lb_facts.py +++ b/lib/ansible/modules/cloud/amazon/elb_application_lb_info.py @@ -12,10 +12,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: elb_application_lb_facts -short_description: Gather facts about application ELBs in AWS +module: elb_application_lb_info +short_description: Gather information about application ELBs in AWS description: - - Gather facts about application ELBs in AWS + - 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. version_added: "2.4" requirements: [ boto3 ] author: Rob White (@wimnat) @@ -37,26 +38,26 @@ extends_documentation_fragment: EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Gather facts about all target groups -- elb_application_lb_facts: +# Gather information about all target groups +- elb_application_lb_info: -# Gather facts about the target group attached to a particular ELB -- elb_application_lb_facts: +# Gather information about the target group attached to a particular ELB +- elb_application_lb_info: load_balancer_arns: - "arn:aws:elasticloadbalancing:ap-southeast-2:001122334455:loadbalancer/app/my-elb/aabbccddeeff" -# Gather facts about a target groups named 'tg1' and 'tg2' -- elb_application_lb_facts: +# Gather information about a target groups named 'tg1' and 'tg2' +- elb_application_lb_info: names: - elb1 - elb2 -# Gather facts about specific ALB -- elb_application_lb_facts: +# Gather information about specific ALB +- elb_application_lb_info: names: "alb-name" region: "aws-region" - register: alb_facts -- debug: var=alb_facts + register: alb_info +- debug: var=alb_info ''' RETURN = ''' @@ -268,6 +269,8 @@ 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'", version='2.13') if not HAS_BOTO3: module.fail_json(msg='boto3 required for this module') diff --git a/lib/ansible/modules/cloud/amazon/elb_classic_lb_facts.py b/lib/ansible/modules/cloud/amazon/elb_classic_lb_info.py similarity index 86% rename from lib/ansible/modules/cloud/amazon/elb_classic_lb_facts.py rename to lib/ansible/modules/cloud/amazon/elb_classic_lb_info.py index ab034b21911..fce8c4455c5 100644 --- a/lib/ansible/modules/cloud/amazon/elb_classic_lb_facts.py +++ b/lib/ansible/modules/cloud/amazon/elb_classic_lb_info.py @@ -20,10 +20,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: elb_classic_lb_facts -short_description: Gather facts about EC2 Elastic Load Balancers in AWS +module: elb_classic_lb_info +short_description: Gather information about EC2 Elastic Load Balancers in AWS description: - - Gather facts about EC2 Elastic Load Balancers in AWS + - 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. version_added: "2.0" author: - "Michael Schultz (@mjschultz)" @@ -31,7 +32,7 @@ author: options: names: description: - - List of ELB names to gather facts about. Pass this option to gather facts about a set of ELBs, otherwise, all ELBs are returned. + - List of ELB names to gather information about. Pass this option to gather information about a set of ELBs, otherwise, all ELBs are returned. aliases: ['elb_ids', 'ec2_elbs'] extends_documentation_fragment: - aws @@ -45,32 +46,32 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. # Output format tries to match ec2_elb_lb module input parameters -# Gather facts about all ELBs -- elb_classic_lb_facts: - register: elb_facts +# Gather information about all ELBs +- elb_classic_lb_info: + register: elb_info - debug: msg: "{{ item.dns_name }}" - loop: "{{ elb_facts.elbs }}" + loop: "{{ elb_info.elbs }}" -# Gather facts about a particular ELB -- elb_classic_lb_facts: +# Gather information about a particular ELB +- elb_classic_lb_info: names: frontend-prod-elb - register: elb_facts + register: elb_info - debug: - msg: "{{ elb_facts.elbs.0.dns_name }}" + msg: "{{ elb_info.elbs.0.dns_name }}" -# Gather facts about a set of ELBs -- elb_classic_lb_facts: +# Gather information about a set of ELBs +- elb_classic_lb_info: names: - frontend-prod-elb - backend-prod-elb - register: elb_facts + register: elb_info - debug: msg: "{{ item.dns_name }}" - loop: "{{ elb_facts.elbs }}" + loop: "{{ elb_info.elbs }}" ''' @@ -203,6 +204,8 @@ 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'", version='2.13') region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True) connection = boto3_conn(module, conn_type='client', resource='elb', region=region, endpoint=ec2_url, **aws_connect_params) @@ -210,7 +213,7 @@ def main(): try: elbs = list_elbs(connection, module.params.get('names')) except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: - module.fail_json_aws(e, msg="Failed to get load balancer facts.") + module.fail_json_aws(e, msg="Failed to get load balancer information.") module.exit_json(elbs=elbs) diff --git a/lib/ansible/modules/cloud/amazon/elb_target_group_facts.py b/lib/ansible/modules/cloud/amazon/elb_target_group_info.py similarity index 94% rename from lib/ansible/modules/cloud/amazon/elb_target_group_facts.py rename to lib/ansible/modules/cloud/amazon/elb_target_group_info.py index 46dcae438d8..bc903d84ac9 100644 --- a/lib/ansible/modules/cloud/amazon/elb_target_group_facts.py +++ b/lib/ansible/modules/cloud/amazon/elb_target_group_info.py @@ -12,10 +12,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: elb_target_group_facts -short_description: Gather facts about ELB target groups in AWS +module: elb_target_group_info +short_description: Gather information about ELB target groups in AWS description: - - Gather facts about ELB target groups in AWS + - 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. version_added: "2.4" requirements: [ boto3 ] author: Rob White (@wimnat) @@ -48,15 +49,15 @@ extends_documentation_fragment: EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Gather facts about all target groups -- elb_target_group_facts: +# Gather information about all target groups +- elb_target_group_info: -# Gather facts about the target group attached to a particular ELB -- elb_target_group_facts: +# Gather information about the target group attached to a particular ELB +- elb_target_group_info: load_balancer_arn: "arn:aws:elasticloadbalancing:ap-southeast-2:001122334455:loadbalancer/app/my-elb/aabbccddeeff" -# Gather facts about a target groups named 'tg1' and 'tg2' -- elb_target_group_facts: +# Gather information about a target groups named 'tg1' and 'tg2' +- elb_target_group_info: names: - tg1 - tg2 @@ -305,6 +306,8 @@ 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'", version='2.13') if not HAS_BOTO3: module.fail_json(msg='boto3 required for this module') diff --git a/lib/ansible/modules/cloud/amazon/elb_target_facts.py b/lib/ansible/modules/cloud/amazon/elb_target_info.py similarity index 94% rename from lib/ansible/modules/cloud/amazon/elb_target_facts.py rename to lib/ansible/modules/cloud/amazon/elb_target_info.py index 04520ccbd50..ac185c24448 100644 --- a/lib/ansible/modules/cloud/amazon/elb_target_facts.py +++ b/lib/ansible/modules/cloud/amazon/elb_target_info.py @@ -10,18 +10,19 @@ ANSIBLE_METADATA = {"metadata_version": "1.1", DOCUMENTATION = """ --- -module: elb_target_facts +module: elb_target_info short_description: Gathers which target groups a target is associated with. 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. version_added: "2.7" author: "Yaakov Kuperman (@yaakov-github)" options: instance_id: description: - - What instance ID to get facts for. + - What instance ID to get information for. type: str required: true get_unused_target_groups: @@ -46,14 +47,14 @@ EXAMPLES = """ - name: Get initial list of target groups delegate_to: localhost - elb_target_facts: + elb_target_info: instance_id: "{{ ansible_ec2_instance_id }}" region: "{{ ansible_ec2_placement_region }}" - register: target_facts + register: target_info - name: save fact for later set_fact: - original_tgs: "{{ target_facts.instance_target_groups }}" + original_tgs: "{{ target_info.instance_target_groups }}" - name: Deregister instance from all target groups delegate_to: localhost @@ -75,12 +76,12 @@ EXAMPLES = """ - name: wait for all targets to deregister simultaneously delegate_to: localhost - elb_target_facts: + elb_target_info: get_unused_target_groups: false instance_id: "{{ ansible_ec2_instance_id }}" region: "{{ ansible_ec2_placement_region }}" - register: target_facts - until: (target_facts.instance_target_groups | length) == 0 + register: target_info + until: (target_info.instance_target_groups | length) == 0 retries: 60 delay: 10 @@ -100,12 +101,12 @@ EXAMPLES = """ # wait until all groups associated with this instance are 'healthy' or # 'unused' - name: wait for registration - elb_target_facts: + elb_target_info: get_unused_target_groups: false instance_id: "{{ ansible_ec2_instance_id }}" region: "{{ ansible_ec2_placement_region }}" - register: target_facts - until: (target_facts.instance_target_groups | + register: target_info + until: (target_info.instance_target_groups | map(attribute='targets') | flatten | map(attribute='target_health') | @@ -129,7 +130,7 @@ EXAMPLES = """ Port={{target.target_port}}{%if target.target_az%},AvailabilityZone={{target.target_az}} {%endif%} {%endfor%} - loop: "{{target_facts.instance_target_groups}}" + loop: "{{target_info.instance_target_groups}}" """ @@ -256,7 +257,7 @@ class TargetGroup(object): return list(self.targets) -class TargetFactsGatherer(object): +class TargetInfoGatherer(object): def __init__(self, module, instance_id, get_unused_target_groups): self.module = module @@ -416,14 +417,16 @@ 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'", version='2.13') instance_id = module.params["instance_id"] get_unused_target_groups = module.params["get_unused_target_groups"] - tg_gatherer = TargetFactsGatherer(module, - instance_id, - get_unused_target_groups - ) + tg_gatherer = TargetInfoGatherer(module, + instance_id, + get_unused_target_groups + ) instance_target_groups = [each.to_dict() for each in tg_gatherer.tgs] diff --git a/lib/ansible/modules/cloud/amazon/iam_mfa_device_facts.py b/lib/ansible/modules/cloud/amazon/iam_mfa_device_info.py similarity index 91% rename from lib/ansible/modules/cloud/amazon/iam_mfa_device_facts.py rename to lib/ansible/modules/cloud/amazon/iam_mfa_device_info.py index 8ba8d3f5499..33a888e8d3f 100644 --- a/lib/ansible/modules/cloud/amazon/iam_mfa_device_facts.py +++ b/lib/ansible/modules/cloud/amazon/iam_mfa_device_info.py @@ -13,10 +13,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: iam_mfa_device_facts +module: iam_mfa_device_info 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. version_added: "2.2" author: Victor Costan (@pwnall) options: @@ -49,7 +50,7 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. # List MFA devices (more details: https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListMFADevices.html) -- iam_mfa_device_facts: +- iam_mfa_device_info: register: mfa_devices # Assume an existing role (more details: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) @@ -96,6 +97,8 @@ def main(): ) module = AnsibleModule(argument_spec=argument_spec) + if module._name == 'iam_mfa_device_facts': + module.deprecate("The 'iam_mfa_device_facts' module has been renamed to 'iam_mfa_device_info'", version='2.13') if not HAS_BOTO3: module.fail_json(msg='boto3 required for this module') diff --git a/lib/ansible/modules/cloud/amazon/iam_role_facts.py b/lib/ansible/modules/cloud/amazon/iam_role_info.py similarity index 96% rename from lib/ansible/modules/cloud/amazon/iam_role_facts.py rename to lib/ansible/modules/cloud/amazon/iam_role_info.py index 3eff6cfa3d5..c495e69e4dc 100644 --- a/lib/ansible/modules/cloud/amazon/iam_role_facts.py +++ b/lib/ansible/modules/cloud/amazon/iam_role_info.py @@ -13,10 +13,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: iam_role_facts +module: iam_role_info 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. version_added: "2.5" requirements: [ boto3 ] author: @@ -39,15 +40,15 @@ extends_documentation_fragment: EXAMPLES = ''' # find all existing IAM roles -- iam_role_facts: +- iam_role_info: register: result # describe a single role -- iam_role_facts: +- iam_role_info: name: MyIAMRole # describe all roles matching a path prefix -- iam_role_facts: +- iam_role_info: path_prefix: /application/path ''' @@ -235,6 +236,8 @@ 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'", version='2.13') region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True) client = boto3_conn(module, conn_type='client', resource='iam', diff --git a/lib/ansible/modules/cloud/amazon/iam_server_certificate_facts.py b/lib/ansible/modules/cloud/amazon/iam_server_certificate_info.py similarity index 91% rename from lib/ansible/modules/cloud/amazon/iam_server_certificate_facts.py rename to lib/ansible/modules/cloud/amazon/iam_server_certificate_info.py index fa67ed50736..9f833ea2a14 100644 --- a/lib/ansible/modules/cloud/amazon/iam_server_certificate_facts.py +++ b/lib/ansible/modules/cloud/amazon/iam_server_certificate_info.py @@ -13,10 +13,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: iam_server_certificate_facts -short_description: Retrieve the facts of a server certificate +module: iam_server_certificate_info +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. version_added: "2.2" author: "Allen Sanabria (@linuxdynasty)" requirements: [boto3, botocore] @@ -32,12 +33,12 @@ extends_documentation_fragment: EXAMPLES = ''' # Retrieve server certificate -- iam_server_certificate_facts: +- iam_server_certificate_info: name: production-cert register: server_cert # Fail if the server certificate name was not found -- iam_server_certificate_facts: +- iam_server_certificate_info: name: production-cert register: server_cert failed_when: "{{ server_cert.results | length == 0 }}" @@ -150,6 +151,8 @@ def main(): )) module = AnsibleModule(argument_spec=argument_spec,) + if module._name == 'iam_server_certificate_facts': + module.deprecate("The 'iam_server_certificate_facts' module has been renamed to 'iam_server_certificate_info'", version='2.13') if not HAS_BOTO3: module.fail_json(msg='boto3 required for this module') diff --git a/lib/ansible/modules/cloud/amazon/rds_instance_facts.py b/lib/ansible/modules/cloud/amazon/rds_instance_info.py similarity index 95% rename from lib/ansible/modules/cloud/amazon/rds_instance_facts.py rename to lib/ansible/modules/cloud/amazon/rds_instance_info.py index 0a479e8cafb..94edf17aa93 100644 --- a/lib/ansible/modules/cloud/amazon/rds_instance_facts.py +++ b/lib/ansible/modules/cloud/amazon/rds_instance_info.py @@ -10,11 +10,12 @@ ANSIBLE_METADATA = {'status': ['preview'], DOCUMENTATION = ''' --- -module: rds_instance_facts +module: rds_instance_info version_added: "2.6" -short_description: obtain facts about one or more RDS instances +short_description: obtain information about one or more RDS instances description: - - obtain facts about one or more RDS instances + - 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: @@ -38,13 +39,13 @@ extends_documentation_fragment: ''' EXAMPLES = ''' -# Get facts about an instance -- rds_instance_facts: +# Get information about an instance +- rds_instance_info: db_instance_identifier: new-database - register: new_database_facts + register: new_database_info # Get all RDS instances -- rds_instance_facts: +- rds_instance_info: ''' RETURN = ''' @@ -350,7 +351,7 @@ except ImportError: pass # handled by AnsibleAWSModule -def instance_facts(module, conn): +def instance_info(module, conn): instance_name = module.params.get('db_instance_identifier') filters = module.params.get('filters') @@ -388,10 +389,12 @@ 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'", version='2.13') conn = module.client('rds', retry_decorator=AWSRetry.jittered_backoff(retries=10)) - module.exit_json(**instance_facts(module, conn)) + module.exit_json(**instance_info(module, conn)) if __name__ == '__main__': diff --git a/lib/ansible/modules/cloud/amazon/rds_snapshot_facts.py b/lib/ansible/modules/cloud/amazon/rds_snapshot_info.py similarity index 90% rename from lib/ansible/modules/cloud/amazon/rds_snapshot_facts.py rename to lib/ansible/modules/cloud/amazon/rds_snapshot_info.py index f565463cf94..871e2b84efd 100644 --- a/lib/ansible/modules/cloud/amazon/rds_snapshot_facts.py +++ b/lib/ansible/modules/cloud/amazon/rds_snapshot_info.py @@ -10,12 +10,13 @@ ANSIBLE_METADATA = {'status': ['preview'], DOCUMENTATION = ''' --- -module: rds_snapshot_facts +module: rds_snapshot_info version_added: "2.6" -short_description: obtain facts about one or more RDS snapshots +short_description: obtain information about one or more RDS snapshots description: - - obtain facts about one or more RDS snapshots. These can be for unclustered snapshots or snapshots of clustered DBs (Aurora) - - Aurora snapshot facts may be obtained if no identifier parameters are passed or if one of the cluster parameters are passed. + - 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: @@ -54,13 +55,13 @@ extends_documentation_fragment: ''' EXAMPLES = ''' -# Get facts about an snapshot -- rds_snapshot_facts: +# Get information about an snapshot +- rds_snapshot_info: db_snapshot_identifier: snapshot_name - register: new_database_facts + register: new_database_info # Get all RDS snapshots for an RDS instance -- rds_snapshot_facts: +- rds_snapshot_info: db_instance_identifier: helloworld-rds-master ''' @@ -293,7 +294,7 @@ except Exception: pass # caught by imported HAS_BOTO3 -def common_snapshot_facts(module, conn, method, prefix, params): +def common_snapshot_info(module, conn, method, prefix, params): paginator = conn.get_paginator(method) try: results = paginator.paginate(**params).build_full_result()['%ss' % prefix] @@ -312,7 +313,7 @@ def common_snapshot_facts(module, conn, method, prefix, params): return [camel_dict_to_snake_dict(snapshot, ignore_list=['Tags']) for snapshot in results] -def cluster_snapshot_facts(module, conn): +def cluster_snapshot_info(module, conn): snapshot_name = module.params.get('db_cluster_snapshot_identifier') snapshot_type = module.params.get('snapshot_type') instance_name = module.params.get('db_cluster_instance_identifier') @@ -329,10 +330,10 @@ def cluster_snapshot_facts(module, conn): elif snapshot_type == 'shared': params['IsShared'] = True - return common_snapshot_facts(module, conn, 'describe_db_cluster_snapshots', 'DBClusterSnapshot', params) + return common_snapshot_info(module, conn, 'describe_db_cluster_snapshots', 'DBClusterSnapshot', params) -def standalone_snapshot_facts(module, conn): +def standalone_snapshot_info(module, conn): snapshot_name = module.params.get('db_snapshot_identifier') snapshot_type = module.params.get('snapshot_type') instance_name = module.params.get('db_instance_identifier') @@ -349,7 +350,7 @@ def standalone_snapshot_facts(module, conn): elif snapshot_type == 'shared': params['IsShared'] = True - return common_snapshot_facts(module, conn, 'describe_db_snapshots', 'DBSnapshot', params) + return common_snapshot_info(module, conn, 'describe_db_snapshots', 'DBSnapshot', params) def main(): @@ -366,13 +367,15 @@ 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'", version='2.13') conn = module.client('rds', retry_decorator=AWSRetry.jittered_backoff(retries=10)) results = dict() if not module.params['db_cluster_identifier'] and not module.params['db_cluster_snapshot_identifier']: - results['snapshots'] = standalone_snapshot_facts(module, conn) + results['snapshots'] = standalone_snapshot_info(module, conn) if not module.params['db_snapshot_identifier'] and not module.params['db_instance_identifier']: - results['cluster_snapshots'] = cluster_snapshot_facts(module, conn) + results['cluster_snapshots'] = cluster_snapshot_info(module, conn) module.exit_json(changed=False, **results) diff --git a/lib/ansible/modules/cloud/amazon/redshift_facts.py b/lib/ansible/modules/cloud/amazon/redshift_info.py similarity index 96% rename from lib/ansible/modules/cloud/amazon/redshift_facts.py rename to lib/ansible/modules/cloud/amazon/redshift_info.py index 239f2d21e96..43a5f309a8f 100644 --- a/lib/ansible/modules/cloud/amazon/redshift_facts.py +++ b/lib/ansible/modules/cloud/amazon/redshift_info.py @@ -13,11 +13,12 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: redshift_facts +module: redshift_info author: "Jens Carl (@j-carl)" -short_description: Gather facts about Redshift cluster(s) +short_description: Gather information about Redshift cluster(s) description: - - Gather facts about Redshift cluster(s) + - Gather information about Redshift cluster(s) + - This module was called C(redshift_facts) before Ansible 2.9. The usage did not change. version_added: "2.4" requirements: [ boto3 ] options: @@ -41,18 +42,18 @@ EXAMPLES = ''' # Note: These examples do net set authentication details, see the AWS guide for details. # Find all clusters -- redshift_facts: +- redshift_info: register: redshift # Find cluster(s) with matching tags -- redshift_facts: +- redshift_info: tags: env: prd stack: monitoring register: redshift_tags # Find cluster(s) with matching name/prefix and tags -- redshift_facts: +- redshift_info: tags: env: dev stack: web @@ -60,7 +61,7 @@ EXAMPLES = ''' register: redshift_web # Fail if no cluster(s) is/are found -- redshift_facts: +- redshift_info: tags: env: stg stack: db @@ -340,6 +341,8 @@ 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'", version='2.13') cluster_identifier = module.params.get('cluster_identifier') cluster_tags = module.params.get('tags') diff --git a/lib/ansible/modules/cloud/amazon/route53_facts.py b/lib/ansible/modules/cloud/amazon/route53_info.py similarity index 96% rename from lib/ansible/modules/cloud/amazon/route53_facts.py rename to lib/ansible/modules/cloud/amazon/route53_info.py index 504f51e6de9..325d2dfd28a 100644 --- a/lib/ansible/modules/cloud/amazon/route53_facts.py +++ b/lib/ansible/modules/cloud/amazon/route53_info.py @@ -12,10 +12,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' -module: route53_facts +module: route53_info short_description: Retrieves route53 details using AWS methods 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. version_added: "2.0" options: query: @@ -126,19 +127,19 @@ extends_documentation_fragment: EXAMPLES = ''' # Simple example of listing all hosted zones - name: List all hosted zones - route53_facts: + route53_info: query: hosted_zone register: hosted_zones # Getting a count of hosted zones - name: Return a count of all hosted zones - route53_facts: + route53_info: query: hosted_zone hosted_zone_method: count register: hosted_zone_count - name: List the first 20 resource record sets in a given hosted zone - route53_facts: + route53_info: profile: account_name query: record_sets hosted_zone_id: ZZZ1111112222 @@ -146,37 +147,37 @@ EXAMPLES = ''' register: record_sets - name: List first 20 health checks - route53_facts: + route53_info: query: health_check health_check_method: list max_items: 20 register: health_checks - name: Get health check last failure_reason - route53_facts: + route53_info: query: health_check health_check_method: failure_reason health_check_id: 00000000-1111-2222-3333-12345678abcd register: health_check_failure_reason - name: Retrieve reusable delegation set details - route53_facts: + route53_info: query: reusable_delegation_set delegation_set_id: delegation id register: delegation_sets - name: setup of example for using next_marker - route53_facts: + route53_info: query: hosted_zone max_items: 1 - register: first_facts + register: first_info - name: example for using next_marker - route53_facts: + route53_info: query: hosted_zone - next_marker: "{{ first_facts.NextMarker }}" + next_marker: "{{ first_info.NextMarker }}" max_items: 1 - when: "{{ 'NextMarker' in first_facts }}" + when: "{{ 'NextMarker' in first_info }}" - name: retrieve host entries starting with host1.workshop.test.io block: @@ -186,7 +187,7 @@ EXAMPLES = ''' register: AWSINFO - name: grab Route53 record information - route53_facts: + route53_info: type: A query: record_sets hosted_zone_id: "{{ AWSINFO.zone_id }}" @@ -437,6 +438,8 @@ def main(): ['hosted_zone_method', 'health_check_method'], ], ) + if module._name == 'route53_facts': + module.deprecate("The 'route53_facts' module has been renamed to 'route53_info'", version='2.13') # Validate Requirements if not (HAS_BOTO or HAS_BOTO3): diff --git a/test/integration/targets/aws_secret/tasks/main.yaml b/test/integration/targets/aws_secret/tasks/main.yaml index f550171d1aa..4f45dfed67c 100644 --- a/test/integration/targets/aws_secret/tasks/main.yaml +++ b/test/integration/targets/aws_secret/tasks/main.yaml @@ -26,18 +26,18 @@ register: iam_role_output ignore_errors: yes - # CI does not remove the role and comparing policies has a bug on Python3; fall back to use iam_role_facts + # CI does not remove the role and comparing policies has a bug on Python3; fall back to use iam_role_info - name: get IAM role - iam_role_facts: + iam_role_info: <<: *aws_connection_info name: "test-secrets-manager-role" when: iam_role_output is failed - register: iam_role_facts + register: iam_role_info - name: set iam_role_output set_fact: - iam_role_output: "{{ iam_role_facts.iam_roles[0] }}" - when: iam_role_facts is defined + iam_role_output: "{{ iam_role_info.iam_roles[0] }}" + when: iam_role_info is defined - name: create a temporary directory tempfile: diff --git a/test/integration/targets/aws_ses_rule_set/tasks/obtain-lock.yaml b/test/integration/targets/aws_ses_rule_set/tasks/obtain-lock.yaml index 69ecaea3332..d12c57c6a67 100644 --- a/test/integration/targets/aws_ses_rule_set/tasks/obtain-lock.yaml +++ b/test/integration/targets/aws_ses_rule_set/tasks/obtain-lock.yaml @@ -85,7 +85,7 @@ register: lock_attempt_log_group_result - name: Get Lock Attempt Lock Groups - cloudwatchlogs_log_group_facts: + cloudwatchlogs_log_group_info: log_group_name: "{{ lock_log_group_prefix }}/" <<: *aws_connection_info register: lock_attempt_log_groups diff --git a/test/integration/targets/ecs_cluster/playbooks/roles/ecs_cluster/tasks/main.yml b/test/integration/targets/ecs_cluster/playbooks/roles/ecs_cluster/tasks/main.yml index a9e8d384c06..474c48ec75e 100644 --- a/test/integration/targets/ecs_cluster/playbooks/roles/ecs_cluster/tasks/main.yml +++ b/test/integration/targets/ecs_cluster/playbooks/roles/ecs_cluster/tasks/main.yml @@ -33,7 +33,7 @@ <<: *aws_connection_info - name: ensure AWSServiceRoleForECS role exists - iam_role_facts: + iam_role_info: name: AWSServiceRoleForECS <<: *aws_connection_info register: iam_role_result diff --git a/test/integration/targets/elb_target_facts/aliases b/test/integration/targets/elb_target_info/aliases similarity index 100% rename from test/integration/targets/elb_target_facts/aliases rename to test/integration/targets/elb_target_info/aliases diff --git a/test/integration/targets/elb_target_facts/playbooks/full_test.yml b/test/integration/targets/elb_target_info/playbooks/full_test.yml similarity index 80% rename from test/integration/targets/elb_target_facts/playbooks/full_test.yml rename to test/integration/targets/elb_target_info/playbooks/full_test.yml index 2cdf1d1a16d..20942527586 100644 --- a/test/integration/targets/elb_target_facts/playbooks/full_test.yml +++ b/test/integration/targets/elb_target_info/playbooks/full_test.yml @@ -3,4 +3,4 @@ environment: "{{ ansible_test.environment }}" roles: - - elb_target_facts + - elb_target_info diff --git a/test/integration/targets/elb_target_facts/playbooks/roles/elb_target_facts/defaults/main.yml b/test/integration/targets/elb_target_info/playbooks/roles/elb_target_facts/defaults/main.yml similarity index 100% rename from test/integration/targets/elb_target_facts/playbooks/roles/elb_target_facts/defaults/main.yml rename to test/integration/targets/elb_target_info/playbooks/roles/elb_target_facts/defaults/main.yml diff --git a/test/integration/targets/elb_target_facts/playbooks/roles/elb_target_facts/tasks/main.yml b/test/integration/targets/elb_target_info/playbooks/roles/elb_target_facts/tasks/main.yml similarity index 97% rename from test/integration/targets/elb_target_facts/playbooks/roles/elb_target_facts/tasks/main.yml rename to test/integration/targets/elb_target_info/playbooks/roles/elb_target_facts/tasks/main.yml index dd74fd62a3e..44cbdb76a2e 100644 --- a/test/integration/targets/elb_target_facts/playbooks/roles/elb_target_facts/tasks/main.yml +++ b/test/integration/targets/elb_target_info/playbooks/roles/elb_target_facts/tasks/main.yml @@ -1,10 +1,10 @@ --- - - name: set up elb_target_facts test prerequisites + - name: set up elb_target_info test prerequisites block: - name: - debug: msg="********** Setting up elb_target_facts test dependencies **********" + debug: msg="********** Setting up elb_target_info test dependencies **********" # ============================================================ - name: set up aws connection info @@ -213,11 +213,11 @@ # ============================================================ - - debug: msg="********** Running elb_target_facts integration tests **********" + - debug: msg="********** Running elb_target_info integration tests **********" # ============================================================ - name: gather facts - elb_target_facts: + elb_target_info: instance_id: "{{ ec2.instance_ids[0]}}" <<: *aws_connection_info register: target_facts @@ -240,7 +240,7 @@ <<: *aws_connection_info - name: gather facts again, including the idle group - elb_target_facts: + elb_target_info: instance_id: "{{ ec2.instance_ids[0]}}" <<: *aws_connection_info register: target_facts @@ -254,7 +254,7 @@ msg: "target facts reflected the addition of the target to the idle group" - name: gather facts again, this time excluding the idle group - elb_target_facts: + elb_target_info: instance_id: "{{ ec2.instance_ids[0]}}" get_unused_target_groups: false <<: *aws_connection_info @@ -279,7 +279,7 @@ <<: *aws_connection_info - name: gather facts - elb_target_facts: + elb_target_info: instance_id: "{{ ec2.instance_ids[0] }}" get_unused_target_groups: false <<: *aws_connection_info @@ -315,7 +315,7 @@ - "targets" - name: wait for all targets to deregister simultaneously - elb_target_facts: + elb_target_info: get_unused_target_groups: false instance_id: "{{ ec2.instance_ids[0] }}" <<: *aws_connection_info @@ -340,7 +340,7 @@ # wait until all groups associated with this instance are 'healthy' or # 'unused' - name: wait for registration - elb_target_facts: + elb_target_info: get_unused_target_groups: false instance_id: "{{ ec2.instance_ids[0] }}" <<: *aws_connection_info @@ -373,7 +373,7 @@ always: - name: - debug: msg="********** Tearing down elb_target_facts test dependencies **********" + debug: msg="********** Tearing down elb_target_info test dependencies **********" - name: remove ec2 instance ec2: diff --git a/test/integration/targets/elb_target_facts/runme.sh b/test/integration/targets/elb_target_info/runme.sh similarity index 100% rename from test/integration/targets/elb_target_facts/runme.sh rename to test/integration/targets/elb_target_info/runme.sh diff --git a/test/integration/targets/rds_instance/tasks/test_final_snapshot.yml b/test/integration/targets/rds_instance/tasks/test_final_snapshot.yml index 91cb9797ff5..0ed654f4fe7 100644 --- a/test/integration/targets/rds_instance/tasks/test_final_snapshot.yml +++ b/test/integration/targets/rds_instance/tasks/test_final_snapshot.yml @@ -48,7 +48,7 @@ - "result.final_snapshot.db_instance_identifier == '{{ instance_id }}'" - name: Check that snapshot exists - rds_snapshot_facts: + rds_snapshot_info: db_snapshot_identifier: "{{ instance_id }}" <<: *aws_connection_info register: result diff --git a/test/integration/targets/route53/tasks/main.yml b/test/integration/targets/route53/tasks/main.yml index d8076a1bd1d..ab3ce25fe02 100644 --- a/test/integration/targets/route53/tasks/main.yml +++ b/test/integration/targets/route53/tasks/main.yml @@ -161,7 +161,7 @@ - caa is not failed - caa is not changed always: - - route53_facts: + - route53_info: query: record_sets hosted_zone_id: '{{ z1.zone_id }}' register: z1_records diff --git a/test/sanity/validate-modules/ignore.txt b/test/sanity/validate-modules/ignore.txt index cc4fac8b85c..a0d412a2248 100644 --- a/test/sanity/validate-modules/ignore.txt +++ b/test/sanity/validate-modules/ignore.txt @@ -48,7 +48,7 @@ lib/ansible/modules/cloud/amazon/elasticache.py E326 lib/ansible/modules/cloud/amazon/elasticache_parameter_group.py E326 lib/ansible/modules/cloud/amazon/elasticache_subnet_group.py E324 lib/ansible/modules/cloud/amazon/elb_application_lb.py E324 -lib/ansible/modules/cloud/amazon/elb_classic_lb_facts.py E323 +lib/ansible/modules/cloud/amazon/elb_classic_lb_info.py E323 lib/ansible/modules/cloud/amazon/elb_instance.py E326 lib/ansible/modules/cloud/amazon/elb_target.py E327 lib/ansible/modules/cloud/amazon/elb_target_group.py E324