X-Git-Url: https://freie-schul-it.de/gitweb/fsit_smgt.git/blobdiff_plain/741976e38a1283b8af5db4526e4d9078108d96b4..eec4e3cff65b179c7244ba83bf7fd7908e3f4059:/tasks/pihole.yml diff --git a/tasks/pihole.yml b/tasks/pihole.yml index 737c9e7..28f4982 100644 --- a/tasks/pihole.yml +++ b/tasks/pihole.yml @@ -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 - # 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