Hi Alexander,
you put me in the right direction. I'd like to give a short example for my
solution:
---
- name: show return value of command yum
hosts: e-stage
tasks:
- name: command
command: yum update-minimal --advisory RHSA-2016:1234
register: yumlog
- command: reboot
I believe something like:
- name: Reboot if packages were updated
command: reboot NOW
when: "'Complete!' in yumoutput"
would do the trick.
http://docs.ansible.com/ansible/playbooks_conditionals.html#applying-when-to-roles-and-includes