Made role OS-specific, added README
This commit is contained in:
parent
f04a39cfc6
commit
b59417c678
5 changed files with 28 additions and 11 deletions
|
@ -23,21 +23,21 @@
|
|||
|
||||
- name: Check whether pi-hole is installed
|
||||
stat:
|
||||
path: /etc/pihole
|
||||
path: "{{ pihole_config_dir }}"
|
||||
register: pihole_dir
|
||||
|
||||
- name: Clone the pi-hole repo
|
||||
ansible.builtin.git:
|
||||
repo: https://github.com/pi-hole/pi-hole.git
|
||||
depth: 1
|
||||
dest: "/var/pi-hole"
|
||||
dest: "{{ pihole_download_dir }}"
|
||||
version: master
|
||||
when: not pihole_dir.stat.exists
|
||||
|
||||
- name: Set /etc/pihole/setupVars.conf
|
||||
- name: Set setupVars.conf
|
||||
template:
|
||||
src: setupVars.conf.j2
|
||||
dest: /etc/pihole/setupVars.conf
|
||||
dest: "{{ pihole_config_dir }}setupVars.conf"
|
||||
owner: root
|
||||
mode: 0400
|
||||
when: not pihole_dir.stat.exists
|
||||
|
@ -45,7 +45,7 @@
|
|||
# pihole unattented install only works if /etc/pihole/setupVars.conf already exists
|
||||
# debug tip: keep track of the install progress by tailing the log-file
|
||||
- name: Run pi-hole install script
|
||||
ansible.builtin.shell: "'/var/pi-hole/automated install/basic-install.sh' --unattended >> {{ ansible_env.HOME }}/pihole_install.log"
|
||||
ansible.builtin.shell: "'{{ pihole_download_dir }}automated install/basic-install.sh' --unattended >> {{ ansible_env.HOME }}/pihole_install.log"
|
||||
args:
|
||||
warn: false
|
||||
when: not pihole_dir.stat.exists
|
||||
|
@ -56,7 +56,7 @@
|
|||
- name: Set local DNS entries
|
||||
template:
|
||||
src: custom.list.j2
|
||||
dest: /etc/pihole/custom.list
|
||||
dest: "{{ pihole_config_dir }}custom.list"
|
||||
owner: root
|
||||
mode: 0664
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue