How to use information from ec2 facts

23 views
Skip to first unread message

Adithya Khamithkar

unread,
Mar 1, 2016, 10:23:06 PM3/1/16
to Ansible Project
Hi,

I am using ec2_remote_facts to find the ec2 facts of an instance based on the tags.

- name: Search ec2
  ec2_remote_facts
:
    filters
:
     
"tag:Name": "{{hostname}}"
    aws_access_key
: "{{aws_access_key}}"
    aws_secret_key
: "{{aws_secret_key}}"
    region
: "{{aws_region}}"
 
register: ec2_info

Now I want to get the instance id of the instance id of that particular host and store it in a variable to use it in my playbook.

Can someone please help in finding or extracting the instance id.

Thanks,
Reply all
Reply to author
Forward
0 new messages