From 91913b64a104a8a1177ec1ec9efff6c4d4405f29 Mon Sep 17 00:00:00 2001 From: Khwezi Date: Sat, 11 Apr 2026 15:14:23 +0200 Subject: [PATCH] Added VPN updater playbook --- ansible-playbooks/update-vpn.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ansible-playbooks/update-vpn.yml diff --git a/ansible-playbooks/update-vpn.yml b/ansible-playbooks/update-vpn.yml new file mode 100644 index 0000000..831e259 --- /dev/null +++ b/ansible-playbooks/update-vpn.yml @@ -0,0 +1,24 @@ +--- +- name: Maintain VPN and Pi-hole + hosts: vpn + become: yes + become_method: sudo + + tasks: + - name: Update Pi-hole + ansible.builtin.shell: pihole -up + args: + executable: /bin/bash + register: pihole_out + changed_when: "'everything is up to date' not in pihole_out.stdout" + + - name: Run PiVPN diagnostics with automated 'Y' responses + ansible.builtin.shell: yes Y | pivpn -d + args: + executable: /bin/bash + register: pivpn_diag + changed_when: false + + - name: Debug Output (Optional) + ansible.builtin.debug: + msg: "Pi-hole update finished. Diagnostic ran successfully." -- 2.47.3