add pihole image update
This commit is contained in:
parent
e229d4b6ba
commit
1580ac41d7
@ -25,4 +25,5 @@ pihole_local_reverse_domain: '1.168.192.in-addr.arpa'
|
|||||||
pihole_local_resolver:
|
pihole_local_resolver:
|
||||||
pihole_dns_servers:
|
pihole_dns_servers:
|
||||||
- '127.0.0.1'
|
- '127.0.0.1'
|
||||||
- '{{pihole_local_resolver | default(1.1.1.1)}}'
|
- '{{pihole_local_resolver | default(1.1.1.1)}}'
|
||||||
|
pihole_update_container: false
|
@ -14,6 +14,13 @@
|
|||||||
__docker_pihole_random_password: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') }}"
|
__docker_pihole_random_password: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') }}"
|
||||||
__docker_pihole_admin_password: "{{ pihole_admin_password | default(__docker_pihole_random_password) }}"
|
__docker_pihole_admin_password: "{{ pihole_admin_password | default(__docker_pihole_random_password) }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: update image if needed
|
||||||
|
docker_image:
|
||||||
|
image: "{{ pihole_image_name }}"
|
||||||
|
force: yes
|
||||||
|
when: pihole_update_container == True
|
||||||
|
|
||||||
- name: "[docker] Setup the pi-hole docker container"
|
- name: "[docker] Setup the pi-hole docker container"
|
||||||
docker_container:
|
docker_container:
|
||||||
name: "{{ pihole_container_name }}"
|
name: "{{ pihole_container_name }}"
|
||||||
@ -33,6 +40,12 @@
|
|||||||
dns_servers: "{{ pihole_dns_servers }}"
|
dns_servers: "{{ pihole_dns_servers }}"
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
|
- name: cleanup old image
|
||||||
|
docker_prune:
|
||||||
|
images: yes
|
||||||
|
when: pihole_update_container == True
|
||||||
|
|
||||||
|
|
||||||
- name: "add custom dnsmask file"
|
- name: "add custom dnsmask file"
|
||||||
template:
|
template:
|
||||||
dest: "{{pihole_host_dir_dnsmasqd}}/02-localresolver.conf" # required. Location to render the template to on the remote machine.
|
dest: "{{pihole_host_dir_dnsmasqd}}/02-localresolver.conf" # required. Location to render the template to on the remote machine.
|
||||||
|
Loading…
Reference in New Issue
Block a user