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