From cc964b66d685cb96fc40eacdccf365cadff1fe63 Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Sat, 14 Mar 2026 19:33:32 -0400 Subject: [PATCH] Add update-instances-repo --- update-instances-repo | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 update-instances-repo diff --git a/update-instances-repo b/update-instances-repo new file mode 100644 index 0000000..f21ace7 --- /dev/null +++ b/update-instances-repo @@ -0,0 +1,33 @@ +--- +- hosts: instances + become: yes + + tasks: + - name: Apt Update with Tailscale recovery + block: + + - name: Apt Update + ansible.builtin.apt: + update_cache: true + + rescue: + + - name: Restart tailscaled if apt update failed + ansible.builtin.systemd: + name: tailscaled + state: restarted + + - name: Retry Apt Update + ansible.builtin.apt: + update_cache: true + + - name: Check if patchmon agent exists + ansible.builtin.stat: + path: /usr/local/bin/patchmon-agent + register: patchmon_agent + + - name: Patchmon agent update + ansible.builtin.command: /usr/local/bin/patchmon-agent report + when: patchmon_agent.stat.exists + changed_when: false + failed_when: false \ No newline at end of file