Ansible v2.0 (master branch) not showing each item in with_items

Skip to first unread message

Fotis Gimian

unread,
Jul 26, 2015, 3:08:36 PM7/26/15
to Ansible Project
Hey there guys, hope everyone is well :)

I'm trying to use v2 (current master from GitHub) but, I've come across a little problem;

e.g. playbook

---
- hosts: localhost
  gather_facts: no
  tasks:
    - shell: /usr/bin/true
      with_items:
        - hello
        - there
        - friends


Ansible 1.9 output

PLAY [localhost] ************************************************************** 


TASK: [shell /usr/bin/true] *************************************************** 

changed: [localhost] => (item=hello)

changed: [localhost] => (item=there)

changed: [localhost] => (item=friends)


PLAY RECAP ******************************************************************** 

localhost                  : ok=1    changed=1    unreachable=0    failed=0   


Ansible 2.0 (master) output

PLAY ****************************************************************************


TASK [command] ******************************************************************

changed: [localhost]


PLAY RECAP **********************************************************************

localhost                  : ok=1    changed=1    unreachable=0    failed=0   


Is there a way to get this additional information back?


Thanks heaps

Fotis

Fotis Gimian

unread,
Jul 28, 2015, 8:43:11 AM7/28/15
to Ansible Project, fgimian...@gmail.com
Apologies to "bump" this folks, but was curious if this is simply the new behaviour in 2.0 or this is a bug?

Cheers
Fotis

Brian Coca

unread,
Jul 28, 2015, 4:33:15 PM7/28/15
to Ansible Project, fgimian...@gmail.com
This was just fixed this morning, please try again with current head.
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/33ab7bf7-1ba4-4854-9ca7-91a8eaa1df10%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Brian Coca

Fotis Gimian

unread,
Jul 28, 2015, 6:19:43 PM7/28/15
to Ansible Project, fgimian...@gmail.com
Thanks Brian, that seems to be a little better, but the progress is only displayed at the end of the run while Ansible 1.9.x displayed it progressively.  Is this possible in 2.0?

I recently also had an idea on this same subject.  In many cases where the data structure is large, the output of each item can be rather overwhelming.  What do you think of an idea whereby users may customise the output of each item in the output.

e.g.

- name: do some stuff
  command: ...
  item_output: "{{ item.name }} ({{ item.category }})"
  with_items:
    - name: something
      category: something
      data1: bla
      data2: bla
      data3: bla
      data4: bla
      data5: bla
    - name: something 2
      category: something 2
      data1: bla 2
      data2: bla 2
      data3: bla 2
      data4: bla 2
      data5: bla 2

Thanks for all your help
Fotis

On Monday, July 27, 2015 at 5:08:36 AM UTC+10, Fotis Gimian wrote:

Brian Coca

unread,
Jul 28, 2015, 6:23:31 PM7/28/15
to Ansible Project, fgimian...@gmail.com
currently output is at the end of the task, we will try to make it per
item but might not be able to do so for 2.0

callback plugins are now much easier to make and use, so you should be
able to change the output to match what you show and customize a
callback easily.
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/e8d64d0f-9cac-46e0-8a65-fb7f90e11b7e%40googlegroups.com.

Fotis Gimian

unread,
Jul 28, 2015, 8:45:03 PM7/28/15
to Brian Coca, Ansible Project
Progressive output would be greatly appreciated, particularly for longer tasks.

Thanks for the tip about callbacks, I'll check them out tonight :)

Really appreciate all your help and time!
Fotis

Fotis Gimian

unread,
Jul 29, 2015, 6:48:37 AM7/29/15
to Ansible Project, fgimian...@gmail.com
After doing a few fresh runs this evening with the newest master branch, I think that for me personally, the value of items being displayed is lost unless the output is progressive.  In cases where I am installing say 20 packages with a single task, it's impossible to know what's currently happening or roughly where it's at.

I also noticed displays a blank item at the end of each with_items output (i.e. one extra line of output).

Would be absolutely awesome if this could be touched up before the beta if possible.  I can't thank you enough for all your dedication and work towards Ansible, I love it and am beginning to recommend it to our project teams.

Cheers
Fotis
Reply all
Reply to author
Forward
0 new messages