homeserver/friedhof/mgrote_dnsmasq_adblocker/tasks/blocklist.yml
Michael Grote 7a24089031 fix linter errors (#584)
Reviewed-on: #584
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Co-committed-by: Michael Grote <michael.grote@posteo.de>
2023-10-25 22:26:17 +02:00

20 lines
542 B
YAML

---
- name: download blocklist(s)
ansible.builtin.get_url:
url: "{{ item.url }}"
dest: "/etc/dnsmasq.d/blocklists/{{ item.name }}"
owner: "{{ dnsmasq_user }}"
group: "{{ dnsmasq_user_group }}"
loop: "{{ dnsmasq_blocklists }}"
when: item.state == "present"
notify: restart dnsmasq
register: download
- name: remove blocklist(s)
ansible.builtin.file:
path: "/etc/dnsmasq.d/blocklists/{{ item.name }}"
state: absent
loop: "{{ dnsmasq_blocklists }}"
when: item.state == "absent"
notify: restart dnsmasq