Initial Ansible automation for hobbs.farm infrastructure
Complete IaC covering: - 14 roles: common, docker, traefik, vaultwarden, monitoring, media, matrix, home_assistant, frigate, adguard, gitea, semaphore, openclaw, security, backup - Inventory for all hosts (Peggy, Bart, Yoda, NAS, Firewalla) - Stack playbooks: core-infrastructure, monitoring, media, communication, automation, smarthome, security-hardening - Maintenance playbooks: update-containers, backup, health-check - Production Docker Compose templates with Traefik labels - Security hardening (sysctl, auditd, UFW, fail2ban) - Automated backups with retention policy
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
---
|
||||
# Global variables for hobbs.farm
|
||||
domain: hobbs.farm
|
||||
timezone: America/Chicago
|
||||
dns_server: 192.168.86.45
|
||||
gateway: 192.168.86.1
|
||||
nas_ip: 192.168.86.30
|
||||
nas_share: "//192.168.86.30/data"
|
||||
|
||||
# SSH
|
||||
ansible_user: glyptic
|
||||
ansible_ssh_private_key_file: ~/.ssh/id_docker_server
|
||||
ansible_python_interpreter: /usr/bin/python3
|
||||
|
||||
# Docker network
|
||||
docker_network_name: homelab_network
|
||||
|
||||
# Traefik
|
||||
traefik_acme_email: "{{ vault_acme_email }}"
|
||||
cloudflare_api_token: "{{ vault_cloudflare_api_token }}"
|
||||
|
||||
# NAS mounts
|
||||
nas_media_path: /mnt/nas/media
|
||||
nas_backup_path: /mnt/nas/backups
|
||||
nas_docker_path: /mnt/nas/docker
|
||||
|
||||
# Common packages
|
||||
common_packages:
|
||||
- htop
|
||||
- iotop
|
||||
- curl
|
||||
- wget
|
||||
- git
|
||||
- jq
|
||||
- unzip
|
||||
- net-tools
|
||||
- ncdu
|
||||
- tmux
|
||||
- rsync
|
||||
- lsof
|
||||
|
||||
# NTP
|
||||
ntp_servers:
|
||||
- 0.us.pool.ntp.org
|
||||
- 1.us.pool.ntp.org
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
docker_compose_base: /data/docker-compose
|
||||
docker_data_dir: /data
|
||||
docker_log_driver: json-file
|
||||
docker_log_max_size: 10m
|
||||
docker_log_max_file: "3"
|
||||
docker_install_compose_plugin: true
|
||||
docker_users:
|
||||
- glyptic
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
prometheus_retention: 30d
|
||||
prometheus_scrape_interval: 15s
|
||||
grafana_admin_password: "{{ vault_grafana_admin_password }}"
|
||||
alertmanager_smtp_host: "{{ vault_smtp_host }}"
|
||||
alertmanager_smtp_from: "alerts@hobbs.farm"
|
||||
alertmanager_slack_webhook: "{{ vault_slack_webhook | default('') }}"
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
ansible_host: 192.168.86.181
|
||||
hostname: bart
|
||||
hardware_description: "Intel i5-4570T, 16GB RAM"
|
||||
os: "Ubuntu"
|
||||
|
||||
# Frigate-specific
|
||||
frigate_config_dir: /opt/frigate/config
|
||||
frigate_media_dir: /media/frigate
|
||||
coral_device: /dev/bus/usb
|
||||
|
||||
backup_sources:
|
||||
- /opt/frigate/config
|
||||
backup_destination: /mnt/nas/backups/bart
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
ansible_host: 192.168.86.1
|
||||
hostname: firewalla
|
||||
device_type: firewall
|
||||
ansible_connection: local
|
||||
note: "Firewalla managed via its own interface. Inventory entry for documentation and monitoring targets."
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
ansible_host: 192.168.86.45
|
||||
hostname: peggy
|
||||
hardware_description: "Intel i7-6700T, 8GB RAM"
|
||||
os: "Ubuntu 24.04"
|
||||
|
||||
docker_compose_stacks:
|
||||
- core-infrastructure
|
||||
- infrastructure
|
||||
- monitoring
|
||||
- media
|
||||
- automation
|
||||
- communication
|
||||
- smarthome
|
||||
|
||||
# NAS mounts for Peggy
|
||||
nfs_mounts:
|
||||
- src: "192.168.86.30:/volume1/media"
|
||||
dest: /mnt/nas/media
|
||||
fstype: nfs
|
||||
opts: "rw,hard,intr,rsize=8192,wsize=8192"
|
||||
- src: "192.168.86.30:/volume1/backups"
|
||||
dest: /mnt/nas/backups
|
||||
fstype: nfs
|
||||
opts: "rw,hard,intr"
|
||||
|
||||
# Backup paths
|
||||
backup_sources:
|
||||
- /data/docker-compose
|
||||
- /data/traefik
|
||||
- /data/vaultwarden
|
||||
- /data/grafana
|
||||
- /data/prometheus
|
||||
- /data/homeassistant
|
||||
- /data/gitea
|
||||
|
||||
backup_destination: /mnt/nas/backups/peggy
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
all:
|
||||
children:
|
||||
docker_hosts:
|
||||
hosts:
|
||||
peggy:
|
||||
ansible_host: 192.168.86.45
|
||||
bart:
|
||||
ansible_host: 192.168.86.181
|
||||
nvr:
|
||||
hosts:
|
||||
bart:
|
||||
yoda:
|
||||
ansible_host: 192.168.86.31
|
||||
ansible_connection: local
|
||||
ansible_shell_type: cmd
|
||||
network:
|
||||
hosts:
|
||||
firewalla:
|
||||
ansible_host: 192.168.86.1
|
||||
ansible_connection: local
|
||||
storage:
|
||||
hosts:
|
||||
nas:
|
||||
ansible_host: 192.168.86.30
|
||||
ansible_connection: local
|
||||
Reference in New Issue
Block a user