Getting more information back from Ansible (Specifically Yum)

25 views
Skip to first unread message

Mike McCormick

unread,
May 20, 2016, 8:45:13 AM5/20/16
to Ansible Project
Hey Guys, 

I'm in the earlier stages of an Ansible deployment. I have one question perhaps someone can help with.

I'm currently firing off an email internally for playbooks as per the mail modules examples.

What I'd really like to do is have ansible return the changes it made during a task, specifically when I update all packages on a host. Even if it can't be emailed, on screen would be good but I can't come across a way to achieve this, any suggestions would be greatly appreciated.

Kind Regards 
Mike 

Brian Coca

unread,
May 20, 2016, 1:07:57 PM5/20/16
to ansible...@googlegroups.com
we can add 'diff' support to the yum module, I believe we just did to the apt module.


----------
Brian Coca

Mike McCormick

unread,
May 23, 2016, 10:53:52 AM5/23/16
to Ansible Project

This would be fantastic. 

I've achieved a not perfect, but half decent workaround so far by grabbing the days changes in yum.log for now:

  - name: Fetching changes made today from yum.log
      become: yes
      shell: date | grep "`awk {'print $2, $3'}`" /var/log/yum.log
      register: yum_log

    - debug: msg="{{ yum_log.stdout_lines }}"
Reply all
Reply to author
Forward
0 new messages