# Possible bug in 1.9.2 ec2

**URL:** <https://forum.ansible.com/t/possible-bug-in-1-9-2-ec2/18588>\
**Category:** Ansible Project\
**Created:** [June 24, 2015, 12:59am UTC](https://forum.ansible.com/t/possible-bug-in-1-9-2-ec2/18588 "2015-06-24T00:59:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barry\_Kaplan](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@Barry\_Kaplan](https://forum.ansible.com/u/Barry_Kaplan)\
**Post date:** [June 24, 2015, 12:59am UTC](https://forum.ansible.com/t/possible-bug-in-1-9-2-ec2/18588/1 "2015-06-24T00:59:38Z")

</div>

I have the following task:

`

- name: Create ELK instance  
ec2:  
image: “{{ubuntu\_image.ami}}”  
region: “{{ec2\_region}}”  
vpc\_subnet\_id: “{{env\_subnets.private|for\_count(item)}}”  
instance\_type: “{{elk\_instance\_type}}”  
assign\_public\_ip: false  
group: “{{security\_groups}}”  
instance\_tags:  
Name: “{{env\_prefix}}elk-{{item}}”  
elk: “group”  
env: “{{env}}”  
managed\_by: ansible  
exact\_count: 1  
count\_tag:  
Name: “{{env\_prefix}}elk-{{item}}”  
key\_name: “{{aws\_key\_name}}”  
wait: yes  
register: ec2\_elk  
with\_sequence: count={{elk\_instance\_count}}  
`

elk\_instance\_count = 1, and all the other attributes have correct values.

When I run this task the instance to be started is already running and the task should be “ok, changed=false” with the ec2\_elk register populated.

With 1.9.1, this is indeed what happens. With 1.9.2-rc2 the status is “skipped” and the ec2\_elk register is not populated.

To help me better debug, does anybody know of a reason why this behavior should have changed?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 26, 2015, 4:45am UTC](https://forum.ansible.com/t/possible-bug-in-1-9-2-ec2/18588/2 "2015-06-26T04:45:33Z")

</div>

this might be a bug, i fixed several issues with the sequence lookup  
in 1.9.2, confirmed that i see what you raised, i did not test for a  
count of 1, I'll add that to the basic tests.

---

<div class="post-metadata">

**Author:** ![Barry\_Kaplan](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@Barry\_Kaplan](https://forum.ansible.com/u/Barry_Kaplan)\
**Post date:** [June 29, 2015, 3:44pm UTC](https://forum.ansible.com/t/possible-bug-in-1-9-2-ec2/18588/3 "2015-06-29T15:44:38Z")

</div>

This remains in 1.9.2

-barry

---

<div class="post-metadata">

**Author:** ![Barry\_Kaplan](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@Barry\_Kaplan](https://forum.ansible.com/u/Barry_Kaplan)\
**Post date:** [June 29, 2015, 3:45pm UTC](https://forum.ansible.com/t/possible-bug-in-1-9-2-ec2/18588/4 "2015-06-29T15:45:43Z")

</div>

And it doesn’t matter if the instance already exists. Even when trying to create new instance the task is skipped. (Which makes sense – a skip is a skip.)

---

<div class="post-metadata">

**Author:** ![Barry\_Kaplan](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@Barry\_Kaplan](https://forum.ansible.com/u/Barry_Kaplan)\
**Post date:** [June 29, 2015, 3:53pm UTC](https://forum.ansible.com/t/possible-bug-in-1-9-2-ec2/18588/5 "2015-06-29T15:53:55Z")

</div>

Looks like it a bug with count=1

`

- name: count=2  
debug: var=item  
with\_sequence: count=2

- name: count=1  
debug: var=item  
with\_sequence: count=1

`

`  
TASK: [count=2] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> (item=1) =\> {  
“item”: “1”,  
“var”: {  
“item”: “1”  
}  
}  
ok: [localhost] =\> (item=2) =\> {  
“item”: “2”,  
“var”: {  
“item”: “2”  
}  
}

TASK: [count=1] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
skipping: [localhost]  
`

(I tried other numbers \> 1 and they all seem to work)

---

<div class="post-metadata">

**Author:** ![Barry\_Kaplan](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@Barry\_Kaplan](https://forum.ansible.com/u/Barry_Kaplan)\
**Post date:** [June 29, 2015, 3:59pm UTC](https://forum.ansible.com/t/possible-bug-in-1-9-2-ec2/18588/6 "2015-06-29T15:59:50Z")

</div>

[https://github.com/ansible/ansible/issues/11422](https://github.com/ansible/ansible/issues/11422)

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [July 3, 2015, 10:35pm UTC](https://forum.ansible.com/t/possible-bug-in-1-9-2-ec2/18588/7 "2015-07-03T22:35:56Z")

</div>

this should be fixed in current devel and in possible future 1.9.3 release
