twinsnes.pihole
Pi-hole
This guide explains how to set up and configure Pi-hole on a Raspberry Pi in your network.
Requirements
- Ansible version 2.9 or newer
Role Variables
Variable Name | Default | Description |
---|---|---|
raspberry_user |
pi | User account that will run Pi-hole. |
dns_server1 |
8.8.8.8 | Primary DNS server IP that Pi-hole will use for requests. |
dns_server2 |
8.8.4.4 | Secondary DNS server IP for fallback if the primary is down. Use "no" to disable it. |
pihole_admin_password |
random | Password for the Pi-hole web interface. It's best to change this to something custom, so you don’t have to search through logs to find the auto-generated password. |
Dependencies
- geerlingguy.docker
- geerlingguy.pip
How to Use
First, install the role on your management node or local machine to get all the necessary dependencies:
ansible-galaxy install twinsnes.pihole
Add the role to your playbook with the required settings for your Pi, or create a new one like this example:
Playbook file:
- hosts: all roles: - name: twinsnes.pihole vars: pihole_admin_password: "SomeSecretPassword"
Using an inventory file can make it easier to manage different hosts and keep their settings saved for future use. This way, when you need to run it again in several months, you won’t have to remember the configurations.
Inventory file:
all: vars: ansible_connection: ssh ansible_ssh_user: pi ansible_ssh_pass: raspberry hosts: raspberry: ansible_host: "192.168.1.100"
After setting up both your playbook and inventory file, run your playbook:
ansible-playbook playbook.yaml -i inventory.yaml
License
Apache-2.0
Informazioni sul progetto
Role to set up and configure Pi-hole on a raspberry pi using docker
Installa
ansible-galaxy install twinsnes.pihole
Licenza
apache-2.0
Download
485
Proprietario