X-Git-Url: https://freie-schul-it.de/gitweb/fsit_smgt.git/blobdiff_plain/f88311d5595818a1ba4c81d20d4144e3988686c7..76764d173a5c86618b179733af5962160f632b51:/tasks/pihole.yml?ds=sidebyside diff --git a/tasks/pihole.yml b/tasks/pihole.yml index c33e9c9..28f4982 100644 --- a/tasks/pihole.yml +++ b/tasks/pihole.yml @@ -1,14 +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 - when: fsit_smgt_dns_upstreams | lenght > 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 - # 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