Need to verify this is really a bug

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

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

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

I get the same results after making the suggested change

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 }}”

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

My apologies, I was too quick and very mistaken:

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

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.