initial pfannkuchen
This commit is contained in:
parent
b6dafc7a73
commit
4d305fa19f
99 changed files with 3575 additions and 321 deletions
6
roles/pihole_dns/defaults/main.yml
Normal file
6
roles/pihole_dns/defaults/main.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
pihole_dns_domain: local
|
||||
pihole_custom_list: /etc/pihole/custom.list
|
||||
pihole_extra_records: []
|
||||
# - ip: 10.4.1.120
|
||||
# name: authentik
|
||||
4
roles/pihole_dns/handlers/main.yml
Normal file
4
roles/pihole_dns/handlers/main.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
- name: Reload Pi-hole DNS
|
||||
ansible.builtin.command: pihole restartdns reload
|
||||
listen: reload pihole dns
|
||||
9
roles/pihole_dns/tasks/main.yml
Normal file
9
roles/pihole_dns/tasks/main.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
- name: Deploy Pi-hole custom DNS records
|
||||
ansible.builtin.template:
|
||||
src: custom.list.j2
|
||||
dest: "{{ pihole_custom_list }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify: reload pihole dns
|
||||
11
roles/pihole_dns/templates/custom.list.j2
Normal file
11
roles/pihole_dns/templates/custom.list.j2
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Von Ansible generiert – nicht manuell bearbeiten
|
||||
{% for host in groups['all'] %}
|
||||
{% if hostvars[host].ansible_host is defined %}
|
||||
{{ hostvars[host].ansible_host }} {{ host }}.{{ pihole_dns_domain }}
|
||||
{{ hostvars[host].ansible_host }} {{ host }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% for entry in pihole_extra_records %}
|
||||
{{ entry.ip }} {{ entry.name }}.{{ pihole_dns_domain }}
|
||||
{{ entry.ip }} {{ entry.name }}
|
||||
{% endfor %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue