using ec2.results

53 views
Skip to first unread message

Eric S

unread,
May 18, 2016, 4:59:48 PM5/18/16
to Ansible Project
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

Johannes Kastl

unread,
May 19, 2016, 3:54:37 AM5/19/16
to ansible...@googlegroups.com
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


signature.asc

Eric S

unread,
May 19, 2016, 10:00:33 AM5/19/16
to Ansible Project
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.

Eric S

unread,
May 19, 2016, 10:03:16 AM5/19/16
to Ansible Project
also this is how I'm launching the instances:
- 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
Reply all
Reply to author
Forward
0 new messages