diff --git a/update-host.yml b/update-host.yml index 602e30c..f67caf9 100644 --- a/update-host.yml +++ b/update-host.yml @@ -20,8 +20,13 @@ ansible.builtin.apt: autoclean: true + - name: Check if patchmon agent exists + ansible.builtin.stat: + path: /usr/local/bin/patchmon-agent.sh + register: patchmon_agent + - name: Patchmon agent update - ansible.builtin.command: /usr/local/bin/patchmon-agent.sh update - register: patchmon_output - changed_when: "'updated' in patchmon_output.stdout.lower()" - failed_when: patchmon_output.rc != 0 \ No newline at end of file + ansible.builtin.command: bash /usr/local/bin/patchmon-agent.sh update + when: patchmon_agent.stat.exists + changed_when: false + failed_when: false \ No newline at end of file