]> freie-schul-it.de Git - fsit_smgt.git/blobdiff - tasks/pihole.yml
Vorbereitung von Tryton Task
[fsit_smgt.git] / tasks / pihole.yml
index c856985b68a56c8aeaf3215d5ece466ee3aabce3..28f4982238624ec2dab72631c9905955f3afcb9b 100644 (file)
@@ -1,13 +1,31 @@
 ---
 ---
-- name: Update dns.upstreams 
+- name: Update ntp.sync.active per group_vars
+  ansible.builtin.command:
+    cmd: pihole-FTL --config  ntp.sync.active '{{ fsit_smgt_ntp_sync_active }}'
+  register: ftl_ntp_sync_active_response
+  changed_when: ftl_ntp_sync_active_response.rc != 0
+  when: fsit_smgt_ntp_sync_active is defined
+- name: Update dns.upstreams per host_vars
   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
   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
+  when: fsit_smgt_dns_upstreams | length > 0
+- name: Update misc.dnsmasq_lines per host_vars
   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
   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
+  when: fsit_smgt_dnsmasq_lines | length > 0
+- name: Update dns.hosts per group_vars
+  ansible.builtin.command:
+    cmd: pihole-FTL --config dns.hosts '{{ fsit_smgt_dns_hosts | to_json }}'
+  register: ftl_dns_hosts_response
+  changed_when: ftl_dns_hosts_response.rc != 0
+  when: fsit_smgt_dns_hosts | length > 0
+- name: Update dhcp.hosts per host_vars
+  ansible.builtin.command:
+    cmd: pihole-FTL --config dhcp.hosts '{{ fsit_smgt_dhcp_hosts | to_json }}'
+  register: ftl_dhcp_hosts_response
+  changed_when: ftl_dhcp_hosts_response.rc != 0
+  when: fsit_smgt_dhcp_hosts | length > 0