# using ec2.results

**URL:** <https://forum.ansible.com/t/using-ec2-results/21481>\
**Category:** Ansible Project\
**Created:** [May 18, 2016, 5:38pm UTC](https://forum.ansible.com/t/using-ec2-results/21481 "2016-05-18T17:38:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_S1](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@Eric\_S1](https://forum.ansible.com/u/Eric_S1)\
**Post date:** [May 18, 2016, 5:38pm UTC](https://forum.ansible.com/t/using-ec2-results/21481/1 "2016-05-18T17:38:48Z")

</div>

when using ec2.results in a task i’m getting:  
[DEPRECATION WARNING]: Skipping task due to undefined Error, in the future this will be a fatal error.: ‘dict object’ has no attribute  
‘results’.

using ansible 2.0.2

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [May 19, 2016, 7:54am UTC](https://forum.ansible.com/t/using-ec2-results/21481/2 "2016-05-19T07:54:21Z")

</div>

You have no results in your dict ec2, apparently. Maybe you are  
registering the variable in the wrong way?

Try adding a task before the one that fails:

- debug: var=ec2

And check, what the output is...

Johannes

---

<div class="post-metadata">

**Author:** ![Eric\_S1](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@Eric\_S1](https://forum.ansible.com/u/Eric_S1)\
**Post date:** [May 19, 2016, 2:00pm UTC](https://forum.ansible.com/t/using-ec2-results/21481/3 "2016-05-19T14:00:33Z")

</div>

When I add that debut task I get the output of the hosts that are in the ec2 var. So its registering correctly because I can see all of the variables held inside of the ec2 var.

---

<div class="post-metadata">

**Author:** ![Eric\_S1](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@Eric\_S1](https://forum.ansible.com/u/Eric_S1)\
**Post date:** [May 19, 2016, 2:03pm UTC](https://forum.ansible.com/t/using-ec2-results/21481/4 "2016-05-19T14:03:16Z")

</div>

also this is how I’m launching the instances:

```auto
- name: Launch Instance
      ec2:
        group_id: "{{ hostvars[inventory_hostname].group_id }}"
        instance_type: 't2.micro'
        image: "{{ hostvars[inventory_hostname].image }}"
        wait: true
        region: 'us-east-1'
        keypair: "{{ key_pair }}"
        vpc_subnet_id: "{{ priv_subnet }}"
        instance_tags: "{{ hostvars[inventory_hostname].tags }}"
        register: ec2

```
