add plattform services
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
---
|
||||
# - name: AUTHENTIK | Verzeichnisse erstellen und Berechtigungen setzen
|
||||
# ansible.builtin.file:
|
||||
# path: "/mnt/cephfs/authentik/data/{{ item }}"
|
||||
# state: directory
|
||||
# owner: 1000
|
||||
# group: 1000
|
||||
# mode: '0755'
|
||||
# loop:
|
||||
# - cache
|
||||
# - certs
|
||||
# - db
|
||||
# - media
|
||||
# - templates
|
||||
# run_once: true
|
||||
# delegate_to: "{{ groups['managers'][0] }}"
|
||||
|
||||
- name: AUTHENTIK | Generate Compose file
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: /mnt/cephfs/authentik/authentik.yml
|
||||
mode: 0644
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['managers'][0] }}"
|
||||
|
||||
- name: AUTHENTIK | Deploy app stack
|
||||
community.docker.docker_stack:
|
||||
state: present
|
||||
name: authentik
|
||||
compose:
|
||||
- /mnt/cephfs/authentik/authentik.yml
|
||||
delegate_to: "{{ groups['managers'][0] }}"
|
||||
run_once: true
|
||||
@@ -0,0 +1,100 @@
|
||||
---
|
||||
networks:
|
||||
traefik_public:
|
||||
external: true
|
||||
internal:
|
||||
|
||||
services:
|
||||
postgresql:
|
||||
image: docker.io/library/postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -d $POSTGRES_DB -U $POSTGRES_USER"]
|
||||
start_period: 20s
|
||||
interval: 30s
|
||||
retries: 5
|
||||
timeout: 5s
|
||||
volumes:
|
||||
- /mnt/cephfs/authentik/data/db:/var/lib/postgresql/data
|
||||
environment:
|
||||
POSTGRES_PASSWORD: "{{ pg_pass }}"
|
||||
POSTGRES_USER: "{{ pg_user | default('authentik') }}"
|
||||
POSTGRES_DB: "{{ pg_db | default('authentik') }}"
|
||||
networks:
|
||||
- internal
|
||||
|
||||
redis:
|
||||
image: docker.io/library/redis:alpine
|
||||
command: --save 60 1 --loglevel warning
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
|
||||
start_period: 20s
|
||||
interval: 30s
|
||||
retries: 5
|
||||
timeout: 3s
|
||||
volumes:
|
||||
- /mnt/cephfs/authentik/data/cache:/data
|
||||
networks:
|
||||
- internal
|
||||
|
||||
server:
|
||||
image: "{{ authentik_image | default('ghcr.io/goauthentik/server') }}:{{ authentik_tag | default('2025.6.3') }}"
|
||||
restart: unless-stopped
|
||||
command: server
|
||||
environment:
|
||||
AUTHENTIK_SECRET_KEY: "{{ authentik_secret_key }}"
|
||||
AUTHENTIK_REDIS__HOST: redis
|
||||
AUTHENTIK_POSTGRESQL__HOST: postgresql
|
||||
AUTHENTIK_POSTGRESQL__USER: "{{ pg_user | default('authentik') }}"
|
||||
AUTHENTIK_POSTGRESQL__NAME: "{{ pg_db | default('authentik') }}"
|
||||
AUTHENTIK_POSTGRESQL__PASSWORD: "{{ pg_pass }}"
|
||||
AUTHENTIK_ERROR_REPORTING__ENABLED: "false"
|
||||
volumes:
|
||||
- /mnt/cephfs/authentik/data/media:/media
|
||||
- /mnt/cephfs/authentik/data/templates:/templates
|
||||
networks:
|
||||
- traefik_public
|
||||
- internal
|
||||
deploy:
|
||||
labels:
|
||||
traefik.enable: "true"
|
||||
traefik.swarm.network: {{ traefik_net }}
|
||||
traefik.http.routers.authentik.rule: Host(`{{ traefik_route }}`) || HostRegexp(`{subdomain:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?}.genius.ceo`) && PathPrefix(`/outpost.goauthentik.io/`)
|
||||
traefik.http.routers.authentik.entrypoints: https
|
||||
traefik.http.routers.authentik.tls: "true"
|
||||
traefik.http.routers.authentik.tls.certresolver: main
|
||||
traefik.http.services.authentik.loadbalancer.server.port: 9000
|
||||
# - "traefik.enable=true"
|
||||
# - "traefik.swarm.network={{ traefik_net }}"
|
||||
# - "traefik.http.routers.authentik.rule=Host(`{{ traefik_route }}`) || HostRegexp(`{subdomain:[A-Za-z0-9](?:[A-Za-z0-9\-]{0,61}[A-Za-z0-9])?}.genius.ceo`) && PathPrefix(`/outpost.goauthentik.io/`)"
|
||||
# - "traefik.http.routers.authentik.entrypoints=https"
|
||||
# - "traefik.http.routers.authentik.tls=true"
|
||||
# - "traefik.http.routers.authentik.tls.certresolver=main"
|
||||
# - "traefik.http.services.authentik.loadbalancer.server.port=9000"
|
||||
|
||||
worker:
|
||||
image: "{{ authentik_image | default('ghcr.io/goauthentik/server') }}:{{ authentik_tag | default('2025.6.3') }}"
|
||||
restart: unless-stopped
|
||||
command: worker
|
||||
environment:
|
||||
AUTHENTIK_SECRET_KEY: "{{ authentik_secret_key }}"
|
||||
AUTHENTIK_REDIS__HOST: redis
|
||||
AUTHENTIK_POSTGRESQL__HOST: postgresql
|
||||
AUTHENTIK_POSTGRESQL__USER: "{{ pg_user | default('authentik') }}"
|
||||
AUTHENTIK_POSTGRESQL__NAME: "{{ pg_db | default('authentik') }}"
|
||||
AUTHENTIK_POSTGRESQL__PASSWORD: "{{ pg_pass }}"
|
||||
# `user: root` and the docker socket volume are optional.
|
||||
# See more for the docker socket integration here:
|
||||
# https://goauthentik.io/docs/outposts/integrations/docker
|
||||
# Removing `user: root` also prevents the worker from fixing the permissions
|
||||
# on the mounted folders, so when removing this make sure the folders have the correct UID/GID
|
||||
# (1000:1000 by default)
|
||||
user: root
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /mnt/cephfs/authentik/data/media:/media
|
||||
- /mnt/cephfs/authentik/data/certs:/certs
|
||||
- /mnt/cephfs/authentik/data/templates:/templates
|
||||
networks:
|
||||
- internal
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
authentik_image: "ghcr.io/goauthentik/server"
|
||||
authentik_tag: "2025.6.3"
|
||||
authentik_secret_key: ""
|
||||
|
||||
pg_user: "authentik"
|
||||
pg_pass: ""
|
||||
pg_db: "authentik"
|
||||
|
||||
traefik_net: "traefik_public"
|
||||
traefik_route: "auth.genius.ceo"
|
||||
Reference in New Issue
Block a user