Getting more information back from Ansible (Specifically Yum)

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

we can add ‘diff’ support to the yum module, I believe we just did to the apt module.

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