Implemented all service roles

- docker: install Docker Engine from official apt repo, configure log rotation,
  create shared traefik_public network
- traefik: reverse proxy with automatic Let's Encrypt TLS, dashboard on
  cloud.ladkau.de behind basic auth
- gitea: self-hosted Git with PostgreSQL, Git-over-SSH on port 2222
- sso: Keycloak with PostgreSQL for OIDC/OAuth2 single sign-on
- nextcloud: file storage with PostgreSQL, Redis, cron sidecar, CalDAV/CardDAV
  well-known redirects
- mail: Roundcube webmail client with PostgreSQL
- registry: Docker Registry v2 with htpasswd auth, no upload size limit
- k8s: placeholder nginx page

All secrets documented in vault.yml; runbook updated with per-service
first-run notes.
This commit is contained in:
ml
2026-06-27 15:35:15 +02:00
parent 6115d9d48f
commit 75a0f21f74
30 changed files with 979 additions and 10 deletions
+7
View File
@@ -0,0 +1,7 @@
---
- name: Restart traefik
community.docker.docker_compose_v2:
project_src: "{{ traefik_data_dir }}"
state: present
pull: missing
recreate: always
+47 -1
View File
@@ -1,2 +1,48 @@
---
# TODO: implement traefik role
- name: Create Traefik data directory
ansible.builtin.file:
path: "{{ traefik_data_dir }}"
state: directory
owner: root
group: root
mode: "0750"
tags: traefik
# acme.json must be 0600 or Traefik refuses to start
- name: Create acme.json for certificate storage
ansible.builtin.file:
path: "{{ traefik_data_dir }}/acme.json"
state: touch
owner: root
group: root
mode: "0600"
modification_time: preserve
access_time: preserve
tags: traefik
- name: Deploy Traefik static config
ansible.builtin.template:
src: traefik.yml.j2
dest: "{{ traefik_data_dir }}/traefik.yml"
owner: root
group: root
mode: "0644"
notify: Restart traefik
tags: traefik
- name: Deploy Docker Compose file
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{ traefik_data_dir }}/docker-compose.yml"
owner: root
group: root
mode: "0644"
notify: Restart traefik
tags: traefik
- name: Start Traefik
community.docker.docker_compose_v2:
project_src: "{{ traefik_data_dir }}"
state: present
pull: missing
tags: traefik
@@ -0,0 +1,28 @@
# Managed by Ansible — do not edit manually
services:
traefik:
image: traefik:{{ traefik_version }}
container_name: traefik
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- {{ traefik_data_dir }}/traefik.yml:/traefik.yml:ro
- {{ traefik_data_dir }}/acme.json:/acme.json
networks:
- traefik_public
labels:
- "traefik.enable=true"
# Dashboard — accessible at cloud.ladkau.de/dashboard/ protected by basic auth
- "traefik.http.routers.dashboard.rule=Host(`{{ domain_cloud }}`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- "traefik.http.routers.dashboard.entrypoints=websecure"
- "traefik.http.routers.dashboard.tls.certresolver=letsencrypt"
- "traefik.http.routers.dashboard.service=api@internal"
- "traefik.http.routers.dashboard.middlewares=dashboard-auth"
- "traefik.http.middlewares.dashboard-auth.basicauth.users={{ traefik_dashboard_users }}"
networks:
traefik_public:
external: true
@@ -0,0 +1,37 @@
# Managed by Ansible — do not edit manually
global:
checkNewVersion: false
sendAnonymousUsage: false
api:
dashboard: true
log:
level: INFO
accessLog: {}
entryPoints:
web:
address: ":80"
http:
redirections:
entryPoint:
to: websecure
scheme: https
permanent: true
websecure:
address: ":443"
providers:
docker:
exposedByDefault: false
network: "{{ traefik_network }}"
certificatesResolvers:
letsencrypt:
acme:
email: "{{ acme_email }}"
storage: /acme.json
httpChallenge:
entryPoint: web