Infra/ansible/roles/pihole/tasks/configure.yml

56 lines
1.5 KiB
YAML
Raw Normal View History

2021-08-17 00:05:31 +02:00
- name: Set pihole webpassword
2022-10-19 00:16:16 +02:00
become: "{{ do_become }}"
2021-08-17 00:05:31 +02:00
ansible.builtin.lineinfile:
path: /etc/pihole/setupVars.conf
regexp: "^WEBPASSWORD="
line: WEBPASSWORD={{ pihole.password | hash("sha256") | hash("sha256") | default("")}}
create: yes
- name: Set pihole theme
2022-10-19 00:16:16 +02:00
become: "{{ do_become }}"
2021-08-17 00:05:31 +02:00
ansible.builtin.lineinfile:
path: /etc/pihole/setupVars.conf
regexp: "^WEBTHEME="
line: WEBTHEME=default-dark #default-dark default-darker default-light
create: yes
- name: Set pihole layout
2022-10-19 00:16:16 +02:00
become: "{{ do_become }}"
2021-08-17 00:05:31 +02:00
ansible.builtin.lineinfile:
path: /etc/pihole/setupVars.conf
regexp: "^WEBUIBOXEDLAYOUT="
line: WEBUIBOXEDLAYOUT=boxed
create: yes
- name: Set pihole listen
2022-10-19 00:16:16 +02:00
become: "{{ do_become }}"
2021-08-17 00:05:31 +02:00
ansible.builtin.lineinfile:
path: /etc/pihole/setupVars.conf
regexp: "^DNSMASQ_LISTENING="
2022-10-18 22:13:55 +02:00
line: DNSMASQ_LISTENING=single
2021-08-17 00:05:31 +02:00
create: yes
- name: Set pihole fqdn forwarding
2022-10-19 00:16:16 +02:00
become: "{{ do_become }}"
2021-08-17 00:05:31 +02:00
ansible.builtin.lineinfile:
path: /etc/pihole/setupVars.conf
regexp: "^DNS_FQDN_REQUIRED="
line: DNS_FQDN_REQUIRED=true
create: yes
- name: Set pihole reverse lookup
2022-10-19 00:16:16 +02:00
become: "{{ do_become }}"
2021-08-17 00:05:31 +02:00
ansible.builtin.lineinfile:
path: /etc/pihole/setupVars.conf
regexp: "^DNS_BOGUS_PRIV="
line: DNS_BOGUS_PRIV=true
create: yes
2022-10-18 22:13:55 +02:00
- name: Set pihole iCloud relay
2022-10-19 00:16:16 +02:00
become: "{{ do_become }}"
2022-10-18 22:13:55 +02:00
ansible.builtin.lineinfile:
path: /etc/pihole/setupVars.conf
regexp: "^BLOCK_ICLOUD_PR="
line: BLOCK_ICLOUD_PR=false
create: yes