Ansible playbook for deploying pihole in docker, along with supporting services. This is work in progress.
To install dependencies, run:
ansible-galaxy install -r requirements.yml && ansible-galaxy collection install -r requirements.yml
To run the playbook:
- Copy the
inventory.yml.example
file toinventory.yml
, and modify it to reflect the hosts you want to install on. (How to build your inventory - Asible Docs) - Copy the
vars.default.yml
file tovars.yml
, and change the variables to reflect your own setup preferences. - Run
ansible-playbook main.yml -i inventory -K
to run the playbook.
What the playbook will do:
- Install docker and docker-compose (also ensure the user is added to the docker group)
- Updates the host to disable the DNSStubResolver of systemd-resolved
- Installs pihole using a compose file
- [Optional] Installs pihole-node-exporter using a compose file, and sets it up to gather info from the pihole instance
- [Optional] Installs portainer-agent
- [Optional] Registers the portainer agent to a portainer instance
- [Optional] Install prometheus-node-exporter