diff options
author | mail_redacted_for_web | 2021-12-12 20:17:14 +0100 |
---|---|---|
committer | mail_redacted_for_web | 2021-12-12 20:17:14 +0100 |
commit | b128bf828f9ce37e8e060b364bab788036fcfd2d (patch) | |
tree | c35004ee13410f8d780160b1df7093c6abbb0d9c /patch.yml | |
parent | 4318b085ade9d9df6906d16d5b01e6b19f287f22 (diff) | |
download | ansible-b128bf828f9ce37e8e060b364bab788036fcfd2d.tar.bz2 |
needrestart for services
Diffstat (limited to 'patch.yml')
-rw-r--r-- | patch.yml | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -213,6 +213,19 @@ notify: "Reboot if required" # failed_when necessary to have a change for RC 1 instead of a failure failed_when: kernout.rc > 1 + - name: Check for outdated services (Debian, Arch) + shell: /usr/sbin/needrestart -pl + register: svcout + when: + - nrex.stat.exists == true + - nrex.stat.executable == true + become: true + changed_when: "svcout.rc|int == 1" + listen: "debian arch needrestart" + # we'll play it safe here: outdated services? --> reboot. + notify: "Reboot if required" + # failed_when necessary to have a change for RC 1 instead of a failure + failed_when: svcout.rc > 1 - name: Update zypper cache (SUSE) # we cannot cheat like we did with yum: we need to update any package to refresh the cache with the zypper module. Hence falling back # to shell. |