From d3765ada569b8adb65c599a550be7a23aa677ef4 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Wed, 1 Feb 2023 11:27:16 +0100 Subject: [PATCH] nagios-nrpe: old wrapper might be missing --- nagios-nrpe/tasks/wrapper.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nagios-nrpe/tasks/wrapper.yml b/nagios-nrpe/tasks/wrapper.yml index 99cd50f3..f49c7509 100644 --- a/nagios-nrpe/tasks/wrapper.yml +++ b/nagios-nrpe/tasks/wrapper.yml @@ -5,10 +5,16 @@ include_role: name: remount-usr +- name: check if old script is present + stat: + path: /usr/share/scripts/alerts_switch + register: old_alerts_switch + - name: alerts_switch is at the right place command: "mv /usr/share/scripts/alerts_switch /usr/local/bin/alerts_switch" args: creates: /usr/local/bin/alerts_switch + when: old_alerts_switch.stat.exists - name: "copy alerts_switch" copy: @@ -24,6 +30,7 @@ src: /usr/local/bin/alerts_switch dest: /usr/share/scripts/alerts_switch state: link + when: old_alerts_switch.stat.exists - name: "copy alerts_wrapper" copy: