From 2cc861721333387fa7e3c47fe4c464a57220e063 Mon Sep 17 00:00:00 2001 From: Robert Pufky Date: Sun, 2 Oct 2022 13:58:54 -0700 Subject: [PATCH] Add support for updating pihole installation. * Pihole installation may now be upgraded to latest version on configuration application if enabled. --- defaults/main/main.yml | 4 ++++ tasks/main.yml | 1 + tasks/update.yml | 9 +++++++++ 3 files changed, 14 insertions(+) create mode 100644 tasks/update.yml diff --git a/defaults/main/main.yml b/defaults/main/main.yml index 739f391..80f9ea1 100644 --- a/defaults/main/main.yml +++ b/defaults/main/main.yml @@ -21,6 +21,10 @@ pihole_local_backup: 'group_vars/pihole/data/pihole-teleporter.tar.gz' # Default: False. pihole_use_cli: false +# Apply any pihole updates during configuration? Otherwise updates must be done +# via the GUI or CLI. Default: False. +pihole_update_enable: false + ############################################################################### # Pi-Hole setupVars.conf ############################################################################### diff --git a/tasks/main.yml b/tasks/main.yml index 428f2d1..fe40b96 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,3 +1,4 @@ --- - ansible.builtin.import_tasks: install.yml - ansible.builtin.import_tasks: db.yml +- ansible.builtin.import_tasks: update.yml diff --git a/tasks/update.yml b/tasks/update.yml new file mode 100644 index 0000000..5e3de34 --- /dev/null +++ b/tasks/update.yml @@ -0,0 +1,9 @@ +--- +############################################################################### +# Pi-Hole Update +############################################################################### +# Update pihole using pihole update mechanism if enabled. + +- name: 'update | updating pihole installation' + ansible.builtin.command: "pihole updatePihole" + when: pihole_update_enable