# Need to verify this is really a bug

**URL:** <https://forum.ansible.com/t/need-to-verify-this-is-really-a-bug/15086>\
**Category:** Ansible Project\
**Created:** [April 24, 2014, 6:03pm UTC](https://forum.ansible.com/t/need-to-verify-this-is-really-a-bug/15086 "2014-04-24T18:03:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Baydoun](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Michael\_Baydoun](https://forum.ansible.com/u/Michael_Baydoun)\
**Post date:** [April 24, 2014, 6:03pm UTC](https://forum.ansible.com/t/need-to-verify-this-is-really-a-bug/15086/1 "2014-04-24T18:03:52Z")

</div>

Small playbook that reproduces behavior [https://gist.github.com/IndyMichaelB/11263577](https://gist.github.com/IndyMichaelB/11263577)  
First comment shows the output

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [April 24, 2014, 6:07pm UTC](https://forum.ansible.com/t/need-to-verify-this-is-really-a-bug/15086/2 "2014-04-24T18:07:53Z")

</div>

with fistvar you use that list of lines, so  
secondvar is the registered output of a loop, which means you have “several sets of results”

change  
debug: var=secondvar.stdout\_lines

to  
debug: var=secondvar.results.stdout\_lines

HTH,

Serge

---

<div class="post-metadata">

**Author:** ![marc.petrivelli](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/marc.petrivelli/32/3773_2.png) [@marc.petrivelli](https://forum.ansible.com/u/marc.petrivelli)\
**Post date:** [April 24, 2014, 6:10pm UTC](https://forum.ansible.com/t/need-to-verify-this-is-really-a-bug/15086/3 "2014-04-24T18:10:04Z")

</div>

You sure you don’t want to use this instead? [http://docs.ansible.com/playbooks\_loops.html#iterating-over-the-results-of-a-program-execution](http://docs.ansible.com/playbooks_loops.html#iterating-over-the-results-of-a-program-execution)

---

<div class="post-metadata">

**Author:** ![Michael\_Baydoun](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Michael\_Baydoun](https://forum.ansible.com/u/Michael_Baydoun)\
**Post date:** [April 24, 2014, 6:12pm UTC](https://forum.ansible.com/t/need-to-verify-this-is-really-a-bug/15086/4 "2014-04-24T18:12:46Z")

</div>

I get the same results after making the suggested change

---

<div class="post-metadata">

**Author:** ![Michael\_Baydoun](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Michael\_Baydoun](https://forum.ansible.com/u/Michael_Baydoun)\
**Post date:** [April 24, 2014, 6:18pm UTC](https://forum.ansible.com/t/need-to-verify-this-is-really-a-bug/15086/5 "2014-04-24T18:18:00Z")

</div>

If I debug all of secondvar I can see the output I want, and it looks like it should be contained in secondvar.results.stdout, but if I try to debug seconvar.results.stdout I only get

“secondvar.results.stdout”: “{{ secondvar.results.stdout }}”

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [April 24, 2014, 6:38pm UTC](https://forum.ansible.com/t/need-to-verify-this-is-really-a-bug/15086/6 "2014-04-24T18:38:06Z")

</div>

secondvar.results is a list of dictionaries, that has keys like ‘stdout’ and ‘stdout\_lines’

So secondvar.results[0].stdout would give you the stdout of the first iteration

If you are looking to again loop over all items in stdout\_lines for each iteration, you need to do something like

- debug: var=item  
with\_flattened: secondvar.results|map(attribute=‘stdout\_lines’)|list

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [April 24, 2014, 6:40pm UTC](https://forum.ansible.com/t/need-to-verify-this-is-really-a-bug/15086/7 "2014-04-24T18:40:32Z")

</div>

My apologies, I was too quick and very mistaken:

---

<div class="post-metadata">

**Author:** ![Michael\_Baydoun](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Michael\_Baydoun](https://forum.ansible.com/u/Michael_Baydoun)\
**Post date:** [April 24, 2014, 7:09pm UTC](https://forum.ansible.com/t/need-to-verify-this-is-really-a-bug/15086/8 "2014-04-24T19:09:06Z")

</div>

Thanks all! I figured it was user error and not a bug 🙂

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [April 24, 2014, 7:29pm UTC](https://forum.ansible.com/t/need-to-verify-this-is-really-a-bug/15086/9 "2014-04-24T19:29:07Z")

</div>

Please include some English description about a problem when posting to this list as well.

It’s helpful to understand what you want and so forth without having to read it all and mentally compile ansible in my head.
