39 lines
786 B
YAML
39 lines
786 B
YAML
- name: Install Pihole
|
|
hosts: all
|
|
become: true
|
|
|
|
tasks:
|
|
- name: Update packages
|
|
apt:
|
|
update_cache: true
|
|
upgrade: safe
|
|
|
|
- name: Install curl
|
|
apt:
|
|
name: curl
|
|
|
|
- name: Create pihole directory
|
|
file:
|
|
path: /etc/pihole
|
|
state: directory
|
|
force: false
|
|
|
|
- name: Load pihole pre-configuration
|
|
copy:
|
|
src: pihole.toml
|
|
dest: /etc/pihole/pihole.toml
|
|
|
|
- name: Download install script
|
|
get_url:
|
|
url: https://install.pi-hole.net
|
|
dest: /tmp/install_pihole.sh
|
|
mode: "0755"
|
|
|
|
- name: Install pihole
|
|
command: /tmp/install_pihole.sh --unattended
|
|
args:
|
|
creates: "/usr/local/bin/pihole"
|
|
|
|
- name: Update gravity lists
|
|
command: pihole -g
|