No description
- Jinja 100%
| config | ||
| roles | ||
| .gitignore | ||
| hosts | ||
| README.md | ||
| requirements.yml | ||
| site.yml | ||
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 passwordANSIBLE_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 syncingproxy: Proxy servers running nginx-proxy-manager and crowdsec (proxy_1)
Playbook Structure
site.yml is the main playbook with three plays:
- All hosts: Runs common roles (instance, apt, administrators, ssh)
- DNS hosts: Installs Docker and Pihole
- DNS_1 host: Adds nebula-sync for syncing Pihole gravity database
- Proxy hosts: Installs Docker, crowdsec, and nginx-proxy-manager
Roles
instance: Base instance configurationapt: APT package managementadministrators: User and admin account setupssh: SSH server configurationdocker: Docker installation and setuppihole: Pihole DNS server deployment (Docker-based)nebula-sync: Syncs Pihole gravity database between dns_1 and dns_2crowdsec: Crowdsec security enginenginx-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.ymlnebula-sync:roles/nebula-sync/files/docker-compose.yml