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.
This commit is contained in:
Felix Fontein 2019-06-10 17:48:07 +02:00 committed by GitHub
parent 3bee49a3bb
commit fc4bbff6e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 244 additions and 164 deletions

2
.github/BOTMETA.yml vendored
View file

@ -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

View file

@ -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``.

View file

@ -102,6 +102,19 @@ Noteworthy module changes
* The ``aws_region_facts`` module was renamed to :ref:`aws_region_info <aws_region_info_module>`.
* The ``aws_sgw_facts`` module was renamed to :ref:`aws_sgw_info <aws_sgw_info_module>`.
* The ``aws_waf_facts`` module was renamed to :ref:`aws_waf_info <aws_waf_info_module>`.
* The ``cloudwatchlogs_log_group_facts`` module was renamed to :ref:`cloudwatchlogs_log_group_info <cloudwatchlogs_log_group_info_module>`.
* The ``elasticache_facts`` module was renamed to :ref:`elasticache_info <elasticache_info_module>`.
* The ``elb_application_lb_facts`` module was renamed to :ref:`elb_application_lb_info <elb_application_lb_info_module>`.
* The ``elb_classic_lb_facts`` module was renamed to :ref:`elb_classic_lb_info <elb_classic_lb_info_module>`.
* The ``elb_target_facts`` module was renamed to :ref:`elb_target_info <elb_target_info_module>`.
* The ``elb_target_group_facts`` module was renamed to :ref:`elb_target_group_info <elb_target_group_info_module>`.
* The ``iam_mfa_device_facts`` module was renamed to :ref:`iam_mfa_device_info <iam_mfa_device_info_module>`.
* The ``iam_role_facts`` module was renamed to :ref:`iam_role_info <iam_role_info_module>`.
* The ``iam_server_certificate_facts`` module was renamed to :ref:`iam_server_certificate_info <iam_server_certificate_info_module>`.
* The ``rds_instance_facts`` module was renamed to :ref:`rds_instance_info <rds_instance_info_module>`.
* The ``rds_snapshot_facts`` module was renamed to :ref:`rds_snapshot_info <rds_snapshot_info_module>`.
* The ``redshift_facts`` module was renamed to :ref:`redshift_info <redshift_info_module>`.
* The ``route53_facts`` module was renamed to :ref:`route53_info <route53_info_module>`.
Plugins

View file

@ -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

View file

@ -0,0 +1 @@
cloudwatchlogs_log_group_info.py

View file

@ -0,0 +1 @@
elasticache_info.py

View file

@ -0,0 +1 @@
elb_application_lb_info.py

View file

@ -0,0 +1 @@
elb_classic_lb_info.py

View file

@ -0,0 +1 @@
elb_target_info.py

View file

@ -0,0 +1 @@
elb_target_group_info.py

View file

@ -1 +1 @@
iam_server_certificate_facts.py
iam_server_certificate_info.py

View file

@ -0,0 +1 @@
iam_mfa_device_info.py

View file

@ -0,0 +1 @@
iam_role_info.py

View file

@ -0,0 +1 @@
iam_server_certificate_info.py

View file

@ -0,0 +1 @@
rds_instance_info.py

View file

@ -0,0 +1 @@
rds_snapshot_info.py

View file

@ -0,0 +1 @@
redshift_info.py

View file

@ -0,0 +1 @@
route53_info.py

View file

@ -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) <willricardo@gmail.com>
@ -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.')

View file

@ -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',

View file

@ -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')

View file

@ -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)

View file

@ -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')

View file

@ -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]

View file

@ -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')

View file

@ -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',

View file

@ -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')

View file

@ -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__':

View file

@ -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)

View file

@ -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')

View file

@ -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):

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -3,4 +3,4 @@
environment: "{{ ansible_test.environment }}"
roles:
- elb_target_facts
- elb_target_info

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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