diff --git a/lib/ansible/modules/cloud/amazon/ec2_eip_facts.py b/lib/ansible/modules/cloud/amazon/ec2_eip_facts.py index 01e926a5d3..0a1f5c06c3 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_eip_facts.py +++ b/lib/ansible/modules/cloud/amazon/ec2_eip_facts.py @@ -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 + '''