Zum Inhalt springen

Installation mit Ansible & Podman ​

Wir pflegen für parcours eine eigene Ansible Rolle, die ein Podman Quadlet Deployment konfiguriert. Auf dem Host muss Podman bereits installiert sein.

Installation der Rolle mit Ansible Galaxy ​

Trage folgenden Eintrag in die requirements.yaml ein:

yaml
roles:
  - name: rokoli.parcours
    src: https://docs.parcours.roko.li/ansible-role.tar.gz

Anschließend müssen die Rollen aktualisiert werden:

shell
ansible-galaxy install -r requirements.yaml

Konfiguration ​

Die Rolle muss anschließend über ein Playbook konfiguriert werden.

yaml
- hosts: [ your-parcours-server ]
  roles:
    - role: rokoli.parcours
      vars:
        parcours_env: production
        parcours_subnet_prefix: 10.212.50
        parcours_hosts: [ parcours.example.org ]
        parcours_secret: my-secret-123
        parcours_postgres_password: my-secret-456
        parcours_valkey_password: my-secret-789
        parcours_nginx_enabled: true
        parcours_nginx_location_includes:
          - "proxy_params"

parcours_secret, parcours_postgres_password und parcours_valkey_password sollten idealerweise in einem Ansible Vault gespeichert werden.

Die Rolle installiert (mit dem obigen Wert für parcours-env) automatisch ein Snippet für NGINX, das in /etc/nginx/snippets/parcours-production.conf abgelegt wird. Das Podman Setup inkludiert weder eine automatische Zertifikatsgenerierung noch einen Reverse Proxy. Diese müssen separat konfiguriert werden.

Nutzdaten und generierte Konfiguration liegen in /var/lib/parcours-production.

Zusätzliche Umgebungsvariablen können in /etc/default/parcours-production gesetzt werden. In /etc/parcours-production/parcours_settings.py kann außerdem die Python-Konfiguration angepasst werden.

Ansible Variablen ​

Die folgenden Variablen können als Teil der Rolle gesetzt werden:

yaml
# Name der parcours Umgebung.
# Wird auch als Suffix für Systempfade und ähnliches genutzt.
parcours_env: production
# Präfix des Subnetznes, in dem der parcours Pod läuft.
parcours_subnet_prefix: 10.212.20
# Port unter die Anwendung auf dem Host veröffentlicht wird (optional).
parcours_publish_port: 0.0.0.0:8000

# Versionen/ Container-Image Tags der jeweiligen Komponenten.
parcours_version: latest
parcours_valkey_version: 8-alpine
parcours_postgres_version: 18

# Authentifizierungsbackend, kann `database`, `ldap` oder `both` sein.
parcours_auth_backend: database
# Sentry DSN
parcours_sentry_dsn: ...

# PostgreSQL Basiskonfiguration
parcours_postgres_user: parcours
parcours_postgres_db: parcours
# PostgreSQL Backupkonfiguration
parcours_postgresql_backup_enabled: false

# Valkey Basiskonfiguration
parcours_valkey_maxmem: 512M

# Steuert, ob die NGINX-Konfiguration generiert werden soll.
parcours_nginx_enabled: false
# Liste von Includes, die in location-Blöcken eingebunden werden sollen.
parcours_nginx_location_includes: [ ]
# Steuert, ob /robots.txt Crawler blockieren soll.
parcours_nginx_disable_robots: true

# Zeitzone
parcours_tz: Europe/Berlin