Ansible ec2_remote_facts
<p>I am using ec2_remote_facts to find the ec2 facts of an instance based on the tags.</p>

<pre><code>- 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
</code></pre>

<p>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.</p>

<p>Can someone please help in finding or extracting the instance id.</p>

<p>Thanks,</p>