From f82cca1ecedcb578c8dd474a32250881bbd3638e Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 23 Feb 2023 20:57:46 -0500 Subject: [PATCH] Add cron to update pihole --- hosts | 2 ++ roles/pihole/tasks/main.yml | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/hosts b/hosts index e920187..1068731 100644 --- a/hosts +++ b/hosts @@ -4,9 +4,11 @@ dns: dns_1: ansible_host: 192.168.1.3 sync_target: 192.168.1.4 + update_weekday: 1 dns_2: ansible_host: 192.168.1.4 sync_target: 192.168.1.3 + update_weekday: 2 proxy: hosts: proxy_1: diff --git a/roles/pihole/tasks/main.yml b/roles/pihole/tasks/main.yml index b0c23e5..ef61891 100644 --- a/roles/pihole/tasks/main.yml +++ b/roles/pihole/tasks/main.yml @@ -52,6 +52,14 @@ cmd: /tmp/basic-install.sh --unattended creates: /usr/local/bin/pihole +- name: Schedule upgrade + cron: + name: schedule upgrade + weekday: "{{ update_weekday }}" + hour: 3 + minute: 0 + job: /usr/local/bin/pihole -up + - name: Create gravity directory file: path: /etc/gravity-sync