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: