1
0
Fork 0
No description
Find a file
2026-07-29 21:26:01 -04:00
config Initial commit 2022-12-21 22:56:39 -05:00
roles Include other stuff 2026-07-29 21:26:01 -04:00
.gitignore Ignore backup during temp solution 2023-05-16 22:11:15 -04:00
hosts Add cron to update pihole 2023-02-23 20:57:46 -05:00
README.md Include other stuff 2026-07-29 21:26:01 -04:00
requirements.yml Include other stuff 2026-07-29 21:26:01 -04:00
site.yml Switch Pihole syncing 2025-10-12 10:00:26 -04:00

home-ansible

Setup random servers at home. It might work sometimes.

Getting started

  • ansible-galaxy install -r requirements.yml

other readme

Overview

This is a home Ansible repository for managing personal servers running Raspberry Pi OS (raspbian). It configures DNS servers (Pihole), proxy servers (nginx-proxy-manager with crowdsec), and common instance setup.

Setup

ansible-galaxy install -r requirements.yml

Environment variables are configured in .mise.toml and include:

  • ANSIBLE_PASSWORD: The ansible become password
  • ANSIBLE_VAULT_PASSWORD_FILE: Path to vault password file (./config/master.key)

Running Playbooks

Run the main playbook against all hosts:

ansible-playbook -i hosts site.yml

Run with specific tags:

ansible-playbook -i hosts site.yml --tags instance
ansible-playbook -i hosts site.yml --tags administrators
ansible-playbook -i hosts site.yml --tags pihole
ansible-playbook -i hosts site.yml --tags cs  # crowdsec
ansible-playbook -i hosts site.yml --tags npm  # nginx-proxy-manager

Run against specific hosts or groups:

ansible-playbook -i hosts site.yml --limit dns
ansible-playbook -i hosts site.yml --limit dns_1
ansible-playbook -i hosts site.yml --limit proxy

Architecture

Inventory Structure

The inventory is defined in the hosts file with three main groups:

  • dns: DNS servers running Pihole in Docker (dns_1, dns_2)
  • dns_1: Subset for the primary DNS server with nebula-sync for Pihole gravity syncing
  • proxy: Proxy servers running nginx-proxy-manager and crowdsec (proxy_1)

Playbook Structure

site.yml is the main playbook with three plays:

  1. All hosts: Runs common roles (instance, apt, administrators, ssh)
  2. DNS hosts: Installs Docker and Pihole
  3. DNS_1 host: Adds nebula-sync for syncing Pihole gravity database
  4. Proxy hosts: Installs Docker, crowdsec, and nginx-proxy-manager

Roles

  • instance: Base instance configuration
  • apt: APT package management
  • administrators: User and admin account setup
  • ssh: SSH server configuration
  • docker: Docker installation and setup
  • pihole: Pihole DNS server deployment (Docker-based)
  • nebula-sync: Syncs Pihole gravity database between dns_1 and dns_2
  • crowdsec: Crowdsec security engine
  • nginx-proxy-manager: Reverse proxy with web UI

Docker Compose Services

Some roles deploy services using Docker Compose:

  • nginx-proxy-manager: roles/nginx-proxy-manager/files/docker-compose.yml
  • nebula-sync: roles/nebula-sync/files/docker-compose.yml