Update ec2_eip_facts.py (#53040)

Add several additional examples showing how to filter on tag, how to filter on the EIP allocation id, and how to set a fact using the output.
pull/4420/head
Brandon Handeland 2019-04-26 09:12:32 -06:00 committed by Alicia Cozine
parent 52a1e4a599
commit 1e2cbefac0
1 changed files with 18 additions and 0 deletions

View File

@ -52,6 +52,24 @@ EXAMPLES = '''
- i-987654321
register: my_vms_eips
# List all EIP addresses using the 'Name' tag as a filter.
- ec2_eip_facts:
filters:
tag:Name: www.example.com
register: my_vms_eips
# List all EIP addresses using the Allocation-id as a filter
- ec2_eip_facts:
filters:
allocation-id: eipalloc-64de1b01
register: my_vms_eips
# Set the variable eip_alloc to the value of the first allocation_id
# and set the variable my_pub_ip to the value of the first public_ip
- set_fact:
eip_alloc: my_vms_eips.addresses[0].allocation_id
my_pub_ip: my_vms_eips.addresses[0].public_ip
'''