]> freie-schul-it.de Git - fsit_smgt.git/commitdiff
Task für DNS-Server mit pihole
authorUllli <ullli@freie-schul-it.de>
Tue, 12 May 2026 10:43:54 +0000 (12:43 +0200)
committerUllli <ullli@freie-schul-it.de>
Tue, 12 May 2026 10:43:54 +0000 (12:43 +0200)
defaults/main.yml
tasks/main.yml
tasks/pihole.yml [new file with mode: 0644]

index 5326f8f427c328e6bc199aa634f6622d7611378f..e812f58d66ad578a0cae19860737aef57c00845d 100644 (file)
@@ -6,3 +6,4 @@ fsit_smgt_homes_ipaddr_lan:
 fsit_smgt_homes_export_root:
 fsit_smgt_homes_lan_homes:
 #fsit_smgt_forgejo_
 fsit_smgt_homes_export_root:
 fsit_smgt_homes_lan_homes:
 #fsit_smgt_forgejo_
+fsit_smgt_dns_upstreams: []
index 26095b958f6a8003e26d486797df7c0dd6eac556..39a012845ed52e780b47c00826523fec138e2c2d 100644 (file)
@@ -1,6 +1,9 @@
 ---
 - name: Bootstrapping 
   ansible.builtin.include_tasks: bootstrap.yml
 ---
 - name: Bootstrapping 
   ansible.builtin.include_tasks: bootstrap.yml
+- name: DNS-Server mit pi-hole
+  ansible.builtin.include_tasks: pihole.yml
+  when: ("pihole" in group_names)
 - name: OpenLDAP-Server
   ansible.builtin.include_tasks: openldap.yml
   when: ("ldap" in group_names) 
 - name: OpenLDAP-Server
   ansible.builtin.include_tasks: openldap.yml
   when: ("ldap" in group_names) 
diff --git a/tasks/pihole.yml b/tasks/pihole.yml
new file mode 100644 (file)
index 0000000..c856985
--- /dev/null
@@ -0,0 +1,13 @@
+---
+- name: Update dns.upstreams 
+  ansible.builtin.command:
+    cmd: pihole-FTL --config dns.upstreams '{{ fsit_smgt_dns_upstreams | to_json }}'
+  register: ftl_dns_upstreams_response
+  changed_when: ftl_dns_upstreams_response.rc != 0
+  when: fsit_smgt_dns_upstreams |lenght > 0
+- name: Update misc.dnsmasq_lines
+  ansible.builtin.command:
+    cmd: pihole-FTL --config misc.dnsmasq_lines '{{ fsit_smgt_dnsmasq_lines | to_json }}'
+  register: ftl_dnsmasq_lines_response
+  changed_when: ftl_dnsmasq_lines_response.rc != 0
+  when: fsit_smgt_dnsmasq_lines |lenght > 0