Post-Tyranny-Tech-Infrastru.../ansible/roles/edge-traefik/tasks/main.yml
Pieter 13685eb454 feat: Add infrastructure roles for multi-tenant architecture
Add new Ansible roles and configuration for the edge proxy and
private network architecture:

## New Roles:
- **edge-traefik**: Edge reverse proxy that routes to private clients
  - Dynamic routing configuration for multiple clients
  - SSL termination at the edge
  - Routes traffic to private IPs (10.0.0.x)

- **nat-gateway**: NAT/gateway configuration for edge server
  - IP forwarding and masquerading
  - Allows private network clients to access internet
  - iptables rules for Docker integration

- **diun**: Docker Image Update Notifier
  - Monitors containers for available updates
  - Email notifications via Mailgun
  - Per-client configuration

- **kuma**: Uptime monitoring integration
  - Registers HTTP monitors for client services
  - Automated monitor creation via API
  - Checks Authentik, Nextcloud, Collabora endpoints

## New Playbooks:
- **setup-edge.yml**: Configure edge server with proxy and NAT

## Configuration:
- **host_vars**: Per-client Ansible configuration (valk, white)
  - SSH bastion configuration for private IPs
  - Client-specific secrets file references

This enables the scalable multi-tenant architecture where:
- Edge server has public IP and routes traffic
- Client servers use private IPs only (cost savings)
- All traffic flows through edge proxy with SSL termination

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-20 19:05:51 +01:00

60 lines
1.4 KiB
YAML

---
# Edge Traefik Installation Tasks
# Sets up Traefik as edge reverse proxy for private network clients
- name: Ensure Traefik configuration directory exists
file:
path: /opt/docker/traefik
state: directory
mode: '0755'
tags: [traefik, edge]
- name: Create Let's Encrypt storage directory
file:
path: /opt/docker/traefik/letsencrypt
state: directory
mode: '0600'
tags: [traefik, edge]
- name: Create Traefik log directory
file:
path: /var/log/traefik
state: directory
mode: '0755'
tags: [traefik, edge]
- name: Deploy Traefik static configuration
template:
src: traefik.yml.j2
dest: /opt/docker/traefik/traefik.yml
mode: '0644'
notify: Restart Traefik
tags: [traefik, edge, config]
- name: Deploy Traefik dynamic configuration (routing rules)
template:
src: dynamic.yml.j2
dest: /opt/docker/traefik/dynamic.yml
mode: '0644'
notify: Restart Traefik
tags: [traefik, edge, config]
- name: Deploy Traefik Docker Compose file
template:
src: docker-compose.yml.j2
dest: /opt/docker/traefik/docker-compose.yml
mode: '0644'
tags: [traefik, edge]
- name: Start Traefik container
community.docker.docker_compose_v2:
project_src: /opt/docker/traefik
state: present
tags: [traefik, edge]
- name: Wait for Traefik to be ready
wait_for:
port: 443
delay: 5
timeout: 60
tags: [traefik, edge]