From add88ab49f6c47646f4423930eba752da9b8773f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Blanco=20L=C3=B3pez?= Date: Thu, 21 Jan 2021 22:14:05 +0100 Subject: [PATCH] Added password setting support --- defaults/main.yml | 6 ++++-- tasks/config.yml | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index fe4bc9a..4d8a1c0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,6 +3,10 @@ pihole_required_packages: - procps +pihole_password: pihole + +pihole_force_reinstall: false + ## Lighttpd config pihole_lighttpd_port: 80 @@ -16,5 +20,3 @@ pihole_query_logging: true pihole_web_server: true pihole_web_interface: true pihole_lighttpd_enabled: true - -pihole_force_reinstall: false diff --git a/tasks/config.yml b/tasks/config.yml index fcea2c6..11b3a1d 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -6,3 +6,7 @@ dest: /etc/lighttpd/lighttpd.conf notify: restart pihole_lighttpd when: pihole_web_server + +- name: Pi-hole | Set password + command: "pihole -a -p {{ pihole_password }}" + when: pihole_password | length > 0