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,5 @@
|
||||
---
|
||||
openclaw_compose_dir: "{{ docker_compose_base }}/automation"
|
||||
openclaw_data_dir: /data/openclaw
|
||||
openclaw_image: "ghcr.io/openclaw/openclaw:latest"
|
||||
openclaw_host: "openclaw.{{ domain }}"
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Create OpenClaw directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: glyptic
|
||||
group: docker
|
||||
mode: "0755"
|
||||
loop:
|
||||
- "{{ openclaw_data_dir }}"
|
||||
tags: [openclaw, automation]
|
||||
|
||||
- name: Deploy OpenClaw compose file
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: "{{ openclaw_compose_dir }}/docker-compose.openclaw.yml"
|
||||
owner: glyptic
|
||||
group: docker
|
||||
mode: "0644"
|
||||
tags: [openclaw, automation]
|
||||
|
||||
- name: Start OpenClaw
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ openclaw_compose_dir }}"
|
||||
files:
|
||||
- docker-compose.openclaw.yml
|
||||
state: present
|
||||
tags: [openclaw, automation]
|
||||
@@ -0,0 +1,22 @@
|
||||
services:
|
||||
openclaw:
|
||||
image: {{ openclaw_image }}
|
||||
container_name: openclaw
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
TZ: {{ timezone }}
|
||||
volumes:
|
||||
- {{ openclaw_data_dir }}:/data
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
labels:
|
||||
traefik.enable: "true"
|
||||
traefik.http.routers.openclaw.rule: "Host(`{{ openclaw_host }}`)"
|
||||
traefik.http.routers.openclaw.entrypoints: websecure
|
||||
traefik.http.routers.openclaw.tls.certresolver: cloudflare
|
||||
traefik.http.services.openclaw.loadbalancer.server.port: "3000"
|
||||
networks:
|
||||
- {{ docker_network_name }}
|
||||
|
||||
networks:
|
||||
{{ docker_network_name }}:
|
||||
external: true
|
||||
Reference in New Issue
Block a user