Infra/ansible/roles/pihole_updatelist/tasks/main.yml

30 lines
769 B
YAML
Raw Normal View History

- name: Checkout pihole_updatelist
tags: [never, init, pihole]
ansible.builtin.git:
repo: "https://github.com/jacklul/pihole-updatelists.git"
clone: yes
dest: "/home/{{ users.0.username }}/pihole_updatelist"
depth: 1
- name: Install updatelist conf
register: updatelist
ansible.builtin.copy:
src: "pihole-updatelists.conf"
dest: "/etc/pihole-updatelists.conf"
mode: "0644"
owner: "root"
group: "root"
2022-10-19 00:16:16 +02:00
become: "{{ do_become }}"
- name: Check if updatelist is installed
2022-04-15 15:51:58 +02:00
ansible.builtin.stat:
path: "/usr/local/sbin/pihole-updatelists"
register: updatelist_exec
- name: Activate changes
2022-04-15 15:51:58 +02:00
when: updatelist_exec.stat.exists
2022-10-19 00:16:16 +02:00
become: "{{ do_become }}"
ansible.builtin.command:
argv:
- pihole-updatelists