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

30 lines
743 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"
become: true
- 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
become: true
ansible.builtin.command:
argv:
- pihole-updatelists