Skip to content

Instantly share code, notes, and snippets.

@Weltraumschaf
Last active January 15, 2022 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Weltraumschaf/1d875484e00f4c397a5841adda1573f1 to your computer and use it in GitHub Desktop.
Save Weltraumschaf/1d875484e00f4c397a5841adda1573f1 to your computer and use it in GitHub Desktop.
Pi-hole unattended
- name: Install Git
apt:
name:
- git
state: latest
- name: Ensure there is a ~/src dir
file:
path: '$HOME/src'
state: directory
- name: Clone Pi-hole repo
git:
repo: https://github.com/pi-hole/pi-hole.git
dest: '$HOME/src/pi-hole'
- name: Ensure there is a /etc/pihole dir
file:
path: '/etc/pihole'
state: directory
- name: Copy setup vars
template:
src: setupVars.conf.j2
dest: /etc/pihole/setupVars.conf
- name: Run Pi-hole installer
shell: '$HOME/src/pi-hole/automated\ install/basic-install.sh --unattended'
- name: Install cron to update pi-hole
cron:
name: 'Automatic update of pi-hole'
job: '/usr/local/bin/pihole -g'
minute: 0
hour: 0
become: no
- name: Install cron to update gravity
cron:
name: 'Automatic update of pi-hole gravity'
job: '/usr/local/bin/pihole -up'
minute: 0
hour: 6
weekday: 6
become: no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment