Reporting individual packages under apt and with_items

89 views
Skip to first unread message

mjwh...@gmail.com

unread,
May 6, 2014, 10:56:51 AM5/6/14
to ansible...@googlegroups.com
I've been testing the apt module and with_items to manage reasonably large (200+) sets of packages. It's comfortably fast - the packages are iterated within the apt module as a single task - but I miss being able to see which individual packages were updated in a given playbook run.

Is there a way to report on this without having a separate task for each package?

Thanks,
Mark <><

Michael DeHaan

unread,
May 6, 2014, 11:23:41 AM5/6/14
to ansible...@googlegroups.com
I'm ok with the modules getting modifications to return this.

Something like an array of 

  {
      installed: [],
      upgraded: [],
      removed: []
}

etc ?

The yum module has a bit better output and we'd want to make strides to keep them the same while not breaking any existing playbooks that used registered values.




--
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/b4ea5573-f4b2-4fb6-9638-1199eaa231fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mjwh...@gmail.com

unread,
May 7, 2014, 2:06:20 PM5/7/14
to ansible...@googlegroups.com
Sounds ideal, yes. I'd wondered about returning a list of tuples with status for each package, but your suggestion is more readable, reducing to empty lists when nothing changed.

I don't think it's possible (yet) to have a mixture of latest/absent/present states in a single call - with_items turns them into separate tasks. But that would be a nice feature in future too, so returning all three lists makes sense.

Thanks,
Mark <><
Reply all
Reply to author
Forward
0 new messages