ansible 2.1.0.0, python 2.7
I am getting this error when trying to create an ec2 instance. It does not matter if the instance already exists or not, so I assume its more of a parsing error. This task works correctly with 1.9. I don’t really see how to debug this. Any ideas?
This this task:
`
- name: Create ES instance
tags: [instance]
ec2:
image: “{{ ubuntu_image.results[0].ami_id }}”
region: “{{ec2_region}}”
vpc_subnet_id: “{{env_subnet.private | select_subnet_id(es_instance_type, item)}}”
instance_type: “{{es_instance_type}}”
instance_profile_name: “{{instance_iam_profile_name}}”
assign_public_ip: false
group: “{{security_groups}}”
volumes: - device_name: /dev/sda1
volume_type: gp2
volume_size: 12
delete_on_termination: true
instance_tags:
Name: “{{env_prefix}}es-{{item}}”
es: “group”
env: “{{env}}”
managed_by: ansible
exact_count: 1
count_tag:
Name: “{{env_prefix}}es-{{item}}”
key_name: “{{aws_key_name}}”
wait: yes
register: ec2_es
with_sequence: start={{es_instance_start}} count={{es_instance_count}}
`
Yields this error:
`
TASK [Create ES instance] ******************************************************
task path: /Users/bkaplan/si/ops/ansible/playbooks/hosts/aws/es-cluster.yml:87
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File “/Users/bkaplan/si/thirdparty/ansible/lib/ansible/executor/task_executor.py”, line 93, in run
items = self._get_loop_items()
File “/Users/bkaplan/si/thirdparty/ansible/lib/ansible/executor/task_executor.py”, line 195, in _get_loop_items
items = self._shared_loader_obj.lookup_loader.get(self._task.loop, loader=self._loader, templar=templar).run(terms=loop_terms, variables=self._job_vars, wantlist=True)
AttributeError: ‘NoneType’ object has no attribute 'run
fatal: [localhost]: FAILED! => {“failed”: true, “msg”: “Unexpected failure during module execution.”, “stdout”: “”}
`