mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
AWS: _facts -> _info (part 3) (#57635)
* Rename ec2_ami_facts -> ec2_ami_info. * Rename ec2_asg_facts -> ec2_asg_info. * Rename ec2_customer_gateway_facts -> ec2_customer_gateway_info. * Rename ec2_eip_facts -> ec2_eip_info. * Rename ec2_elb_facts -> ec2_elb_info. * Rename ec2_eni_facts -> ec2_eni_info. * Rename ec2_group_facts -> ec2_group_info. * Rename ec2_instance_facts -> ec2_instance_info. * Rename ec2_lc_facts -> ec2_lc_info. * Rename ec2_placement_group_facts -> ec2_placement_group_info. * Rename ec2_snapshot_facts -> ec2_snapshot_info. * Rename ec2_vol_facts -> ec2_vol_info. * Update module defaults, add changelog and porting guide. * Forgot one occurence of ec2_instance_facts. * Update BOTMETA. * Break too long line.
This commit is contained in:
parent
1d054a6671
commit
804d5eaf8e
54 changed files with 280 additions and 205 deletions
|
@ -114,39 +114,39 @@ groupings:
|
|||
- aws
|
||||
ec2_ami_copy:
|
||||
- aws
|
||||
ec2_ami_facts:
|
||||
ec2_ami_info:
|
||||
- aws
|
||||
ec2_asg:
|
||||
- aws
|
||||
ec2_asg_facts:
|
||||
ec2_asg_info:
|
||||
- aws
|
||||
ec2_asg_lifecycle_hook:
|
||||
- aws
|
||||
ec2_customer_gateway:
|
||||
- aws
|
||||
ec2_customer_gateway_facts:
|
||||
ec2_customer_gateway_info:
|
||||
- aws
|
||||
ec2_eip:
|
||||
- aws
|
||||
ec2_eip_facts:
|
||||
ec2_eip_info:
|
||||
- aws
|
||||
ec2_elb:
|
||||
- aws
|
||||
ec2_elb_facts:
|
||||
ec2_elb_info:
|
||||
- aws
|
||||
ec2_elb_lb:
|
||||
- aws
|
||||
ec2_eni:
|
||||
- aws
|
||||
ec2_eni_facts:
|
||||
ec2_eni_info:
|
||||
- aws
|
||||
ec2_group:
|
||||
- aws
|
||||
ec2_group_facts:
|
||||
ec2_group_info:
|
||||
- aws
|
||||
ec2_instance:
|
||||
- aws
|
||||
ec2_instance_facts:
|
||||
ec2_instance_info:
|
||||
- aws
|
||||
ec2_key:
|
||||
- aws
|
||||
|
@ -154,7 +154,7 @@ groupings:
|
|||
- aws
|
||||
ec2_lc:
|
||||
- aws
|
||||
ec2_lc_facts:
|
||||
ec2_lc_info:
|
||||
- aws
|
||||
ec2_lc_find:
|
||||
- aws
|
||||
|
@ -162,7 +162,7 @@ groupings:
|
|||
- aws
|
||||
ec2_placement_group:
|
||||
- aws
|
||||
ec2_placement_group_facts:
|
||||
ec2_placement_group_info:
|
||||
- aws
|
||||
ec2_scaling_policy:
|
||||
- aws
|
||||
|
@ -170,13 +170,13 @@ groupings:
|
|||
- aws
|
||||
ec2_snapshot_copy:
|
||||
- aws
|
||||
ec2_snapshot_facts:
|
||||
ec2_snapshot_info:
|
||||
- aws
|
||||
ec2_tag:
|
||||
- aws
|
||||
ec2_vol:
|
||||
- aws
|
||||
ec2_vol_facts:
|
||||
ec2_vol_info:
|
||||
- aws
|
||||
ec2_vpc_dhcp_option:
|
||||
- aws
|
||||
|
|
1
lib/ansible/modules/cloud/amazon/_ec2_ami_facts.py
Symbolic link
1
lib/ansible/modules/cloud/amazon/_ec2_ami_facts.py
Symbolic link
|
@ -0,0 +1 @@
|
|||
ec2_ami_info.py
|
1
lib/ansible/modules/cloud/amazon/_ec2_asg_facts.py
Symbolic link
1
lib/ansible/modules/cloud/amazon/_ec2_asg_facts.py
Symbolic link
|
@ -0,0 +1 @@
|
|||
ec2_asg_info.py
|
1
lib/ansible/modules/cloud/amazon/_ec2_customer_gateway_facts.py
Symbolic link
1
lib/ansible/modules/cloud/amazon/_ec2_customer_gateway_facts.py
Symbolic link
|
@ -0,0 +1 @@
|
|||
ec2_customer_gateway_info.py
|
1
lib/ansible/modules/cloud/amazon/_ec2_eip_facts.py
Symbolic link
1
lib/ansible/modules/cloud/amazon/_ec2_eip_facts.py
Symbolic link
|
@ -0,0 +1 @@
|
|||
ec2_eip_info.py
|
1
lib/ansible/modules/cloud/amazon/_ec2_elb_facts.py
Symbolic link
1
lib/ansible/modules/cloud/amazon/_ec2_elb_facts.py
Symbolic link
|
@ -0,0 +1 @@
|
|||
ec2_elb_info.py
|
1
lib/ansible/modules/cloud/amazon/_ec2_eni_facts.py
Symbolic link
1
lib/ansible/modules/cloud/amazon/_ec2_eni_facts.py
Symbolic link
|
@ -0,0 +1 @@
|
|||
ec2_eni_info.py
|
1
lib/ansible/modules/cloud/amazon/_ec2_group_facts.py
Symbolic link
1
lib/ansible/modules/cloud/amazon/_ec2_group_facts.py
Symbolic link
|
@ -0,0 +1 @@
|
|||
ec2_group_info.py
|
1
lib/ansible/modules/cloud/amazon/_ec2_instance_facts.py
Symbolic link
1
lib/ansible/modules/cloud/amazon/_ec2_instance_facts.py
Symbolic link
|
@ -0,0 +1 @@
|
|||
ec2_instance_info.py
|
1
lib/ansible/modules/cloud/amazon/_ec2_lc_facts.py
Symbolic link
1
lib/ansible/modules/cloud/amazon/_ec2_lc_facts.py
Symbolic link
|
@ -0,0 +1 @@
|
|||
ec2_lc_info.py
|
1
lib/ansible/modules/cloud/amazon/_ec2_placement_group_facts.py
Symbolic link
1
lib/ansible/modules/cloud/amazon/_ec2_placement_group_facts.py
Symbolic link
|
@ -0,0 +1 @@
|
|||
ec2_placement_group_info.py
|
1
lib/ansible/modules/cloud/amazon/_ec2_snapshot_facts.py
Symbolic link
1
lib/ansible/modules/cloud/amazon/_ec2_snapshot_facts.py
Symbolic link
|
@ -0,0 +1 @@
|
|||
ec2_snapshot_info.py
|
1
lib/ansible/modules/cloud/amazon/_ec2_vol_facts.py
Symbolic link
1
lib/ansible/modules/cloud/amazon/_ec2_vol_facts.py
Symbolic link
|
@ -0,0 +1 @@
|
|||
ec2_vol_info.py
|
|
@ -10,10 +10,12 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ec2_ami_facts
|
||||
module: ec2_ami_info
|
||||
version_added: '2.5'
|
||||
short_description: Gather facts about ec2 AMIs
|
||||
description: Gather facts about ec2 AMIs
|
||||
short_description: Gather information about ec2 AMIs
|
||||
description:
|
||||
- Gather information about ec2 AMIs
|
||||
- This module was called C(ec2_ami_facts) before Ansible 2.9. The usage did not change.
|
||||
author:
|
||||
- Prasad Katti (@prasadkatti)
|
||||
requirements: [ boto3 ]
|
||||
|
@ -49,22 +51,22 @@ extends_documentation_fragment:
|
|||
EXAMPLES = '''
|
||||
# Note: These examples do not set authentication details, see the AWS Guide for details.
|
||||
|
||||
- name: gather facts about an AMI using ami-id
|
||||
ec2_ami_facts:
|
||||
- name: gather information about an AMI using ami-id
|
||||
ec2_ami_info:
|
||||
image_ids: ami-5b488823
|
||||
|
||||
- name: gather facts about all AMIs with tag key Name and value webapp
|
||||
ec2_ami_facts:
|
||||
- name: gather information about all AMIs with tag key Name and value webapp
|
||||
ec2_ami_info:
|
||||
filters:
|
||||
"tag:Name": webapp
|
||||
|
||||
- name: gather facts about an AMI with 'AMI Name' equal to foobar
|
||||
ec2_ami_facts:
|
||||
- name: gather information about an AMI with 'AMI Name' equal to foobar
|
||||
ec2_ami_info:
|
||||
filters:
|
||||
name: foobar
|
||||
|
||||
- name: gather facts about Ubuntu 17.04 AMIs published by Canonical (099720109477)
|
||||
ec2_ami_facts:
|
||||
- name: gather information about Ubuntu 17.04 AMIs published by Canonical (099720109477)
|
||||
ec2_ami_info:
|
||||
owners: 099720109477
|
||||
filters:
|
||||
name: "ubuntu/images/ubuntu-zesty-17.04-*"
|
||||
|
@ -252,6 +254,8 @@ def main():
|
|||
)
|
||||
|
||||
module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True)
|
||||
if module._module._name == 'ec2_ami_facts':
|
||||
module._module.deprecate("The 'ec2_ami_facts' module has been renamed to 'ec2_ami_info'", version='2.13')
|
||||
|
||||
region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True)
|
||||
|
|
@ -13,10 +13,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ec2_asg_facts
|
||||
short_description: Gather facts about ec2 Auto Scaling Groups (ASGs) in AWS
|
||||
module: ec2_asg_info
|
||||
short_description: Gather information about ec2 Auto Scaling Groups (ASGs) in AWS
|
||||
description:
|
||||
- Gather facts about ec2 Auto Scaling Groups (ASGs) in AWS
|
||||
- Gather information about ec2 Auto Scaling Groups (ASGs) in AWS
|
||||
- This module was called C(ec2_asg_facts) before Ansible 2.9. The usage did not change.
|
||||
version_added: "2.2"
|
||||
requirements: [ boto3 ]
|
||||
author: "Rob White (@wimnat)"
|
||||
|
@ -41,36 +42,36 @@ EXAMPLES = '''
|
|||
# Note: These examples do not set authentication details, see the AWS Guide for details.
|
||||
|
||||
# Find all groups
|
||||
- ec2_asg_facts:
|
||||
- ec2_asg_info:
|
||||
register: asgs
|
||||
|
||||
# Find a group with matching name/prefix
|
||||
- ec2_asg_facts:
|
||||
- ec2_asg_info:
|
||||
name: public-webserver-asg
|
||||
register: asgs
|
||||
|
||||
# Find a group with matching tags
|
||||
- ec2_asg_facts:
|
||||
- ec2_asg_info:
|
||||
tags:
|
||||
project: webapp
|
||||
env: production
|
||||
register: asgs
|
||||
|
||||
# Find a group with matching name/prefix and tags
|
||||
- ec2_asg_facts:
|
||||
- ec2_asg_info:
|
||||
name: myproject
|
||||
tags:
|
||||
env: production
|
||||
register: asgs
|
||||
|
||||
# Fail if no groups are found
|
||||
- ec2_asg_facts:
|
||||
- ec2_asg_info:
|
||||
name: public-webserver-asg
|
||||
register: asgs
|
||||
failed_when: "{{ asgs.results | length == 0 }}"
|
||||
|
||||
# Fail if more than 1 group is found
|
||||
- ec2_asg_facts:
|
||||
- ec2_asg_info:
|
||||
name: public-webserver-asg
|
||||
register: asgs
|
||||
failed_when: "{{ asgs.results | length > 1 }}"
|
||||
|
@ -395,6 +396,8 @@ def main():
|
|||
)
|
||||
)
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
if module._name == 'ec2_asg_facts':
|
||||
module.deprecate("The 'ec2_asg_facts' module has been renamed to 'ec2_asg_info'", version='2.13')
|
||||
|
||||
if not HAS_BOTO3:
|
||||
module.fail_json(msg='boto3 required for this module')
|
|
@ -8,10 +8,11 @@ ANSIBLE_METADATA = {'status': ['preview'],
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ec2_customer_gateway_facts
|
||||
short_description: Gather facts about customer gateways in AWS
|
||||
module: ec2_customer_gateway_info
|
||||
short_description: Gather information about customer gateways in AWS
|
||||
description:
|
||||
- Gather facts about customer gateways in AWS
|
||||
- Gather information about customer gateways in AWS
|
||||
- This module was called C(ec2_customer_gateway_facts) before Ansible 2.9. The usage did not change.
|
||||
version_added: "2.5"
|
||||
requirements: [ boto3 ]
|
||||
author: Madhura Naniwadekar (@Madhura-CSI)
|
||||
|
@ -31,24 +32,24 @@ extends_documentation_fragment:
|
|||
EXAMPLES = '''
|
||||
# # Note: These examples do not set authentication details, see the AWS Guide for details.
|
||||
|
||||
- name: Gather facts about all customer gateways
|
||||
ec2_customer_gateway_facts:
|
||||
- name: Gather information about all customer gateways
|
||||
ec2_customer_gateway_info:
|
||||
|
||||
- name: Gather facts about a filtered list of customer gateways, based on tags
|
||||
ec2_customer_gateway_facts:
|
||||
- name: Gather information about a filtered list of customer gateways, based on tags
|
||||
ec2_customer_gateway_info:
|
||||
region: ap-southeast-2
|
||||
filters:
|
||||
"tag:Name": test-customer-gateway
|
||||
"tag:AltName": test-customer-gateway-alt
|
||||
register: cust_gw_facts
|
||||
register: cust_gw_info
|
||||
|
||||
- name: Gather facts about a specific customer gateway by specifying customer gateway ID
|
||||
ec2_customer_gateway_facts:
|
||||
- name: Gather information about a specific customer gateway by specifying customer gateway ID
|
||||
ec2_customer_gateway_info:
|
||||
region: ap-southeast-2
|
||||
customer_gateway_ids:
|
||||
- 'cgw-48841a09'
|
||||
- 'cgw-fec021ce'
|
||||
register: cust_gw_facts
|
||||
register: cust_gw_info
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
@ -123,6 +124,8 @@ def main():
|
|||
module = AnsibleAWSModule(argument_spec=argument_spec,
|
||||
mutually_exclusive=[['customer_gateway_ids', 'filters']],
|
||||
supports_check_mode=True)
|
||||
if module._module._name == 'ec2_customer_gateway_facts':
|
||||
module._module.deprecate("The 'ec2_customer_gateway_facts' module has been renamed to 'ec2_customer_gateway_info'", version='2.13')
|
||||
|
||||
region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True)
|
||||
|
|
@ -9,10 +9,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ec2_eip_facts
|
||||
module: ec2_eip_info
|
||||
short_description: List EC2 EIP details
|
||||
description:
|
||||
- List details of EC2 Elastic IP addresses.
|
||||
- This module was called C(ec2_eip_facts) before Ansible 2.9. The usage did not change.
|
||||
version_added: "2.6"
|
||||
author: "Brad Macpherson (@iiibrad)"
|
||||
options:
|
||||
|
@ -33,11 +34,11 @@ EXAMPLES = '''
|
|||
# see the AWS Guide for details.
|
||||
|
||||
# List all EIP addresses in the current region.
|
||||
- ec2_eip_facts:
|
||||
- ec2_eip_info:
|
||||
register: regional_eip_addresses
|
||||
|
||||
# List all EIP addresses for a VM.
|
||||
- ec2_eip_facts:
|
||||
- ec2_eip_info:
|
||||
filters:
|
||||
instance-id: i-123456789
|
||||
register: my_vm_eips
|
||||
|
@ -45,7 +46,7 @@ EXAMPLES = '''
|
|||
- debug: msg="{{ my_vm_eips.addresses | json_query(\"[?private_ip_address=='10.0.0.5']\") }}"
|
||||
|
||||
# List all EIP addresses for several VMs.
|
||||
- ec2_eip_facts:
|
||||
- ec2_eip_info:
|
||||
filters:
|
||||
instance-id:
|
||||
- i-123456789
|
||||
|
@ -53,13 +54,13 @@ EXAMPLES = '''
|
|||
register: my_vms_eips
|
||||
|
||||
# List all EIP addresses using the 'Name' tag as a filter.
|
||||
- ec2_eip_facts:
|
||||
- ec2_eip_info:
|
||||
filters:
|
||||
tag:Name: www.example.com
|
||||
register: my_vms_eips
|
||||
|
||||
# List all EIP addresses using the Allocation-id as a filter
|
||||
- ec2_eip_facts:
|
||||
- ec2_eip_info:
|
||||
filters:
|
||||
allocation-id: eipalloc-64de1b01
|
||||
register: my_vms_eips
|
||||
|
@ -130,6 +131,8 @@ def main():
|
|||
),
|
||||
supports_check_mode=True
|
||||
)
|
||||
if module._module._name == 'ec2_eip_facts':
|
||||
module._module.deprecate("The 'ec2_eip_facts' module has been renamed to 'ec2_eip_info'", version='2.13')
|
||||
|
||||
module.exit_json(changed=False, addresses=get_eips_details(module))
|
||||
|
|
@ -20,10 +20,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ec2_elb_facts
|
||||
short_description: Gather facts about EC2 Elastic Load Balancers in AWS
|
||||
module: ec2_elb_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(ec2_elb_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
|
||||
|
@ -42,38 +43,38 @@ 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
|
||||
# Gather information about all ELBs
|
||||
- action:
|
||||
module: ec2_elb_facts
|
||||
register: elb_facts
|
||||
module: ec2_elb_info
|
||||
register: elb_info
|
||||
|
||||
- action:
|
||||
module: debug
|
||||
msg: "{{ item.dns_name }}"
|
||||
loop: "{{ elb_facts.elbs }}"
|
||||
loop: "{{ elb_info.elbs }}"
|
||||
|
||||
# Gather facts about a particular ELB
|
||||
# Gather information about a particular ELB
|
||||
- action:
|
||||
module: ec2_elb_facts
|
||||
module: ec2_elb_info
|
||||
names: frontend-prod-elb
|
||||
register: elb_facts
|
||||
register: elb_info
|
||||
|
||||
- action:
|
||||
module: debug
|
||||
msg: "{{ elb_facts.elbs.0.dns_name }}"
|
||||
msg: "{{ elb_info.elbs.0.dns_name }}"
|
||||
|
||||
# Gather facts about a set of ELBs
|
||||
# Gather information about a set of ELBs
|
||||
- action:
|
||||
module: ec2_elb_facts
|
||||
module: ec2_elb_info
|
||||
names:
|
||||
- frontend-prod-elb
|
||||
- backend-prod-elb
|
||||
register: elb_facts
|
||||
register: elb_info
|
||||
|
||||
- action:
|
||||
module: debug
|
||||
msg: "{{ item.dns_name }}"
|
||||
loop: "{{ elb_facts.elbs }}"
|
||||
loop: "{{ elb_info.elbs }}"
|
||||
|
||||
'''
|
||||
|
||||
|
@ -238,6 +239,8 @@ def main():
|
|||
)
|
||||
module = AnsibleModule(argument_spec=argument_spec,
|
||||
supports_check_mode=True)
|
||||
if module._name == 'ec2_elb_facts':
|
||||
module.deprecate("The 'ec2_elb_facts' module has been renamed to 'ec2_elb_info'", version='2.13')
|
||||
|
||||
if not HAS_BOTO:
|
||||
module.fail_json(msg='boto required for this module')
|
||||
|
@ -251,14 +254,14 @@ def main():
|
|||
elb_information = ElbInformation(
|
||||
module, names, region, **aws_connect_params)
|
||||
|
||||
ec2_facts_result = dict(changed=False,
|
||||
elbs=elb_information.list_elbs())
|
||||
ec2_info_result = dict(changed=False,
|
||||
elbs=elb_information.list_elbs())
|
||||
|
||||
except BotoServerError as err:
|
||||
module.fail_json(msg="{0}: {1}".format(err.error_code, err.error_message),
|
||||
exception=traceback.format_exc())
|
||||
|
||||
module.exit_json(**ec2_facts_result)
|
||||
module.exit_json(**ec2_info_result)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
|
@ -20,10 +20,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ec2_eni_facts
|
||||
short_description: Gather facts about ec2 ENI interfaces in AWS
|
||||
module: ec2_eni_info
|
||||
short_description: Gather information about ec2 ENI interfaces in AWS
|
||||
description:
|
||||
- Gather facts about ec2 ENI interfaces in AWS
|
||||
- Gather information about ec2 ENI interfaces in AWS
|
||||
- This module was called C(ec2_eni_facts) before Ansible 2.9. The usage did not change.
|
||||
version_added: "2.0"
|
||||
author: "Rob White (@wimnat)"
|
||||
requirements: [ boto3 ]
|
||||
|
@ -40,11 +41,11 @@ extends_documentation_fragment:
|
|||
EXAMPLES = '''
|
||||
# Note: These examples do not set authentication details, see the AWS Guide for details.
|
||||
|
||||
# Gather facts about all ENIs
|
||||
- ec2_eni_facts:
|
||||
# Gather information about all ENIs
|
||||
- ec2_eni_info:
|
||||
|
||||
# Gather facts about a particular ENI
|
||||
- ec2_eni_facts:
|
||||
# Gather information about a particular ENI
|
||||
- ec2_eni_info:
|
||||
filters:
|
||||
network-interface-id: eni-xxxxxxx
|
||||
|
||||
|
@ -264,6 +265,8 @@ def main():
|
|||
)
|
||||
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
if module._name == 'ec2_eni_facts':
|
||||
module.deprecate("The 'ec2_eni_facts' module has been renamed to 'ec2_eni_info'", version='2.13')
|
||||
|
||||
if not HAS_BOTO3:
|
||||
module.fail_json(msg='boto3 required for this module')
|
|
@ -13,10 +13,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ec2_group_facts
|
||||
short_description: Gather facts about ec2 security groups in AWS.
|
||||
module: ec2_group_info
|
||||
short_description: Gather information about ec2 security groups in AWS.
|
||||
description:
|
||||
- Gather facts about ec2 security groups in AWS.
|
||||
- Gather information about ec2 security groups in AWS.
|
||||
- This module was called C(ec2_group_facts) before Ansible 2.9. The usage did not change.
|
||||
version_added: "2.3"
|
||||
requirements: [ boto3 ]
|
||||
author:
|
||||
|
@ -41,45 +42,46 @@ extends_documentation_fragment:
|
|||
EXAMPLES = '''
|
||||
# Note: These examples do not set authentication details, see the AWS Guide for details.
|
||||
|
||||
# Gather facts about all security groups
|
||||
- ec2_group_facts:
|
||||
# Gather information about all security groups
|
||||
- ec2_group_info:
|
||||
|
||||
# Gather facts about all security groups in a specific VPC
|
||||
- ec2_group_facts:
|
||||
# Gather information about all security groups in a specific VPC
|
||||
- ec2_group_info:
|
||||
filters:
|
||||
vpc-id: vpc-12345678
|
||||
|
||||
# Gather facts about all security groups in a specific VPC
|
||||
- ec2_group_facts:
|
||||
# Gather information about all security groups in a specific VPC
|
||||
- ec2_group_info:
|
||||
filters:
|
||||
vpc-id: vpc-12345678
|
||||
|
||||
# Gather facts about a security group
|
||||
- ec2_group_facts:
|
||||
# Gather information about a security group
|
||||
- ec2_group_info:
|
||||
filters:
|
||||
group-name: example-1
|
||||
|
||||
# Gather facts about a security group by id
|
||||
- ec2_group_facts:
|
||||
# Gather information about a security group by id
|
||||
- ec2_group_info:
|
||||
filters:
|
||||
group-id: sg-12345678
|
||||
|
||||
# Gather facts about a security group with multiple filters, also mixing the use of underscores as filter keys
|
||||
- ec2_group_facts:
|
||||
# Gather information about a security group with multiple filters, also mixing the use of underscores as filter keys
|
||||
- ec2_group_info:
|
||||
filters:
|
||||
group_id: sg-12345678
|
||||
vpc-id: vpc-12345678
|
||||
|
||||
# Gather facts about various security groups
|
||||
- ec2_group_facts:
|
||||
# Gather information about various security groups
|
||||
- ec2_group_info:
|
||||
filters:
|
||||
group-name:
|
||||
- example-1
|
||||
- example-2
|
||||
- example-3
|
||||
|
||||
# Gather facts about any security group with a tag key Name and value Example. The quotes around 'tag:name' are important because of the colon in the value
|
||||
- ec2_group_facts:
|
||||
# Gather information about any security group with a tag key Name and value Example.
|
||||
# The quotes around 'tag:name' are important because of the colon in the value
|
||||
- ec2_group_info:
|
||||
filters:
|
||||
"tag:Name": Example
|
||||
'''
|
||||
|
@ -115,6 +117,8 @@ def main():
|
|||
|
||||
module = AnsibleModule(argument_spec=argument_spec,
|
||||
supports_check_mode=True)
|
||||
if module._name == 'ec2_group_facts':
|
||||
module.deprecate("The 'ec2_group_facts' module has been renamed to 'ec2_group_info'", version='2.13')
|
||||
|
||||
if not HAS_BOTO3:
|
||||
module.fail_json(msg='boto3 required for this module')
|
|
@ -73,7 +73,7 @@ options:
|
|||
type: bool
|
||||
image:
|
||||
description:
|
||||
- An image to use for the instance. The ec2_ami_facts module may be used to retrieve images.
|
||||
- An image to use for the instance. The M(ec2_ami_info) module may be used to retrieve images.
|
||||
One of I(image) or I(image_id) are required when instance is not already present.
|
||||
- Complex object containing I(image.id), I(image.ramdisk), and I(image.kernel).
|
||||
- I(image.id) is the AMI ID.
|
||||
|
|
|
@ -12,10 +12,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ec2_instance_facts
|
||||
short_description: Gather facts about ec2 instances in AWS
|
||||
module: ec2_instance_info
|
||||
short_description: Gather information about ec2 instances in AWS
|
||||
description:
|
||||
- Gather facts about ec2 instances in AWS
|
||||
- Gather information about ec2 instances in AWS
|
||||
- This module was called C(ec2_instance_facts) before Ansible 2.9. The usage did not change.
|
||||
version_added: "2.4"
|
||||
author:
|
||||
- Michael Schuett (@michaeljs1990)
|
||||
|
@ -43,26 +44,26 @@ extends_documentation_fragment:
|
|||
EXAMPLES = '''
|
||||
# Note: These examples do not set authentication details, see the AWS Guide for details.
|
||||
|
||||
# Gather facts about all instances
|
||||
- ec2_instance_facts:
|
||||
# Gather information about all instances
|
||||
- ec2_instance_info:
|
||||
|
||||
# Gather facts about all instances in AZ ap-southeast-2a
|
||||
- ec2_instance_facts:
|
||||
# Gather information about all instances in AZ ap-southeast-2a
|
||||
- ec2_instance_info:
|
||||
filters:
|
||||
availability-zone: ap-southeast-2a
|
||||
|
||||
# Gather facts about a particular instance using ID
|
||||
- ec2_instance_facts:
|
||||
# Gather information about a particular instance using ID
|
||||
- ec2_instance_info:
|
||||
instance_ids:
|
||||
- i-12345678
|
||||
|
||||
# Gather facts about any instance with a tag key Name and value Example
|
||||
- ec2_instance_facts:
|
||||
# Gather information about any instance with a tag key Name and value Example
|
||||
- ec2_instance_info:
|
||||
filters:
|
||||
"tag:Name": Example
|
||||
|
||||
# Gather facts about any instance in states "shutting-down", "stopping", "stopped"
|
||||
- ec2_instance_facts:
|
||||
# Gather information about any instance in states "shutting-down", "stopping", "stopped"
|
||||
- ec2_instance_info:
|
||||
filters:
|
||||
instance-state-name: [ "shutting-down", "stopping", "stopped" ]
|
||||
|
||||
|
@ -543,6 +544,8 @@ def main():
|
|||
],
|
||||
supports_check_mode=True
|
||||
)
|
||||
if module._name == 'ec2_instance_facts':
|
||||
module.deprecate("The 'ec2_instance_facts' module has been renamed to 'ec2_instance_information'", version='2.13')
|
||||
|
||||
if not HAS_BOTO3:
|
||||
module.fail_json(msg='boto3 required for this module')
|
|
@ -14,10 +14,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ec2_lc_facts
|
||||
short_description: Gather facts about AWS Autoscaling Launch Configurations
|
||||
module: ec2_lc_info
|
||||
short_description: Gather information about AWS Autoscaling Launch Configurations
|
||||
description:
|
||||
- Gather facts about AWS Autoscaling Launch Configurations
|
||||
- Gather information about AWS Autoscaling Launch Configurations
|
||||
- This module was called C(ec2_lc_facts) before Ansible 2.9. The usage did not change.
|
||||
version_added: "2.3"
|
||||
author: "Loïc Latreille (@psykotox)"
|
||||
requirements: [ boto3 ]
|
||||
|
@ -52,15 +53,15 @@ extends_documentation_fragment:
|
|||
EXAMPLES = '''
|
||||
# Note: These examples do not set authentication details, see the AWS Guide for details.
|
||||
|
||||
# Gather facts about all launch configurations
|
||||
- ec2_lc_facts:
|
||||
# Gather information about all launch configurations
|
||||
- ec2_lc_info:
|
||||
|
||||
# Gather facts about launch configuration with name "example"
|
||||
- ec2_lc_facts:
|
||||
# Gather information about launch configuration with name "example"
|
||||
- ec2_lc_info:
|
||||
name: example
|
||||
|
||||
# Gather facts sorted by created_time from most recent to least recent
|
||||
- ec2_lc_facts:
|
||||
# Gather information sorted by created_time from most recent to least recent
|
||||
- ec2_lc_info:
|
||||
sort: created_time
|
||||
sort_order: descending
|
||||
'''
|
||||
|
@ -213,6 +214,8 @@ def main():
|
|||
)
|
||||
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
if module._name == 'ec2_lc_facts':
|
||||
module.deprecate("The 'ec2_lc_facts' module has been renamed to 'ec2_lc_info'", version='2.13')
|
||||
|
||||
if not HAS_BOTO3:
|
||||
module.fail_json(msg='boto3 required for this module')
|
|
@ -9,10 +9,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ec2_placement_group_facts
|
||||
module: ec2_placement_group_info
|
||||
short_description: List EC2 Placement Group(s) details
|
||||
description:
|
||||
- List details of EC2 Placement Group(s).
|
||||
- This module was called C(ec2_placement_group_facts) before Ansible 2.9. The usage did not change.
|
||||
version_added: "2.5"
|
||||
author: "Brad Macpherson (@iiibrad)"
|
||||
options:
|
||||
|
@ -32,11 +33,11 @@ EXAMPLES = '''
|
|||
# see the AWS Guide for details.
|
||||
|
||||
# List all placement groups.
|
||||
- ec2_placement_group_facts:
|
||||
- ec2_placement_group_info:
|
||||
register: all_ec2_placement_groups
|
||||
|
||||
# List two placement groups.
|
||||
- ec2_placement_group_facts:
|
||||
- ec2_placement_group_info:
|
||||
names:
|
||||
- my-cluster
|
||||
- my-other-cluster
|
||||
|
@ -117,6 +118,8 @@ def main():
|
|||
argument_spec=argument_spec,
|
||||
supports_check_mode=True
|
||||
)
|
||||
if module._module._name == 'ec2_placement_group_facts':
|
||||
module._module.deprecate("The 'ec2_placement_group_facts' module has been renamed to 'ec2_placement_group_info'", version='2.13')
|
||||
|
||||
region, ec2_url, aws_connect_params = get_aws_connection_info(
|
||||
module, boto3=True)
|
|
@ -13,10 +13,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ec2_snapshot_facts
|
||||
short_description: Gather facts about ec2 volume snapshots in AWS
|
||||
module: ec2_snapshot_info
|
||||
short_description: Gather information about ec2 volume snapshots in AWS
|
||||
description:
|
||||
- Gather facts about ec2 volume snapshots in AWS
|
||||
- Gather information about ec2 volume snapshots in AWS
|
||||
- This module was called C(ec2_snapshot_facts) before Ansible 2.9. The usage did not change.
|
||||
version_added: "2.1"
|
||||
requirements: [ boto3 ]
|
||||
author: "Rob White (@wimnat)"
|
||||
|
@ -57,36 +58,36 @@ extends_documentation_fragment:
|
|||
EXAMPLES = '''
|
||||
# Note: These examples do not set authentication details, see the AWS Guide for details.
|
||||
|
||||
# Gather facts about all snapshots, including public ones
|
||||
- ec2_snapshot_facts:
|
||||
# Gather information about all snapshots, including public ones
|
||||
- ec2_snapshot_info:
|
||||
|
||||
# Gather facts about all snapshots owned by the account 0123456789
|
||||
- ec2_snapshot_facts:
|
||||
# Gather information about all snapshots owned by the account 0123456789
|
||||
- ec2_snapshot_info:
|
||||
filters:
|
||||
owner-id: 0123456789
|
||||
|
||||
# Or alternatively...
|
||||
- ec2_snapshot_facts:
|
||||
- ec2_snapshot_info:
|
||||
owner_ids:
|
||||
- 0123456789
|
||||
|
||||
# Gather facts about a particular snapshot using ID
|
||||
- ec2_snapshot_facts:
|
||||
# Gather information about a particular snapshot using ID
|
||||
- ec2_snapshot_info:
|
||||
filters:
|
||||
snapshot-id: snap-00112233
|
||||
|
||||
# Or alternatively...
|
||||
- ec2_snapshot_facts:
|
||||
- ec2_snapshot_info:
|
||||
snapshot_ids:
|
||||
- snap-00112233
|
||||
|
||||
# Gather facts about any snapshot with a tag key Name and value Example
|
||||
- ec2_snapshot_facts:
|
||||
# Gather information about any snapshot with a tag key Name and value Example
|
||||
- ec2_snapshot_info:
|
||||
filters:
|
||||
"tag:Name": Example
|
||||
|
||||
# Gather facts about any snapshot with an error status
|
||||
- ec2_snapshot_facts:
|
||||
# Gather information about any snapshot with an error status
|
||||
- ec2_snapshot_info:
|
||||
filters:
|
||||
status: error
|
||||
|
||||
|
@ -230,6 +231,8 @@ def main():
|
|||
['snapshot_ids', 'owner_ids', 'restorable_by_user_ids', 'filters']
|
||||
]
|
||||
)
|
||||
if module._name == 'ec2_snapshot_facts':
|
||||
module.deprecate("The 'ec2_snapshot_facts' module has been renamed to 'ec2_snapshot_info'", version='2.13')
|
||||
|
||||
if not HAS_BOTO3:
|
||||
module.fail_json(msg='boto3 required for this module')
|
|
@ -13,10 +13,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ec2_vol_facts
|
||||
short_description: Gather facts about ec2 volumes in AWS
|
||||
module: ec2_vol_info
|
||||
short_description: Gather information about ec2 volumes in AWS
|
||||
description:
|
||||
- Gather facts about ec2 volumes in AWS
|
||||
- Gather information about ec2 volumes in AWS
|
||||
- This module was called C(ec2_vol_facts) before Ansible 2.9. The usage did not change.
|
||||
version_added: "2.1"
|
||||
requirements: [ boto3 ]
|
||||
author: "Rob White (@wimnat)"
|
||||
|
@ -33,21 +34,21 @@ extends_documentation_fragment:
|
|||
EXAMPLES = '''
|
||||
# Note: These examples do not set authentication details, see the AWS Guide for details.
|
||||
|
||||
# Gather facts about all volumes
|
||||
- ec2_vol_facts:
|
||||
# Gather information about all volumes
|
||||
- ec2_vol_info:
|
||||
|
||||
# Gather facts about a particular volume using volume ID
|
||||
- ec2_vol_facts:
|
||||
# Gather information about a particular volume using volume ID
|
||||
- ec2_vol_info:
|
||||
filters:
|
||||
volume-id: vol-00112233
|
||||
|
||||
# Gather facts about any volume with a tag key Name and value Example
|
||||
- ec2_vol_facts:
|
||||
# Gather information about any volume with a tag key Name and value Example
|
||||
- ec2_vol_info:
|
||||
filters:
|
||||
"tag:Name": Example
|
||||
|
||||
# Gather facts about any volume that is attached
|
||||
- ec2_vol_facts:
|
||||
# Gather information about any volume that is attached
|
||||
- ec2_vol_info:
|
||||
filters:
|
||||
attachment.status: attached
|
||||
|
||||
|
@ -131,6 +132,8 @@ def main():
|
|||
)
|
||||
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
if module._name == 'ec2_vol_facts':
|
||||
module.deprecate("The 'ec2_vol_facts' module has been renamed to 'ec2_vol_info'", version='2.13')
|
||||
|
||||
if not HAS_BOTO3:
|
||||
module.fail_json(msg='boto3 required for this module')
|
Loading…
Add table
Add a link
Reference in a new issue