Files
kevinveenbirkenbachandClaude Opus 4.8 15e7647d2f refactor(env): central TZ+LANG base included by every role env.j2
New roles/sys-svc-container/templates/env.j2 sets TZ={{ HOST_TIMEZONE }} and LANG=C.UTF-8. Every role env.j2 includes it at the top; it renders via stack_host_template, the same engine that resolves the includes in compose.yml.j2, so it works in both compose and swarm. TZ/LANG are removed from the individual role env.j2 so each value stays single-source.

New lint tests/lint/ansible/test_env_base_include.py verifies every role env.j2 includes the base and never re-sets a base-owned key (keys derived from the base file).

mattermost and gitea meta/volumes.yml drop the /etc/timezone host-path bind: swarm hard-rejects a task whose bind source is missing on the node (Debian-trixie nodes have no /etc/timezone). TZ now comes from the base env. /etc/localtime bind also dropped; the container timezone follows TZ.

Non-directive comments were removed from the touched env.j2 (banners, restatements, reference URLs, narration) so the changed files pass the comment-lint; only tool directives remain.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 22:13:57 +02:00

38 lines
1.8 KiB
Django/Jinja

{% include 'roles/sys-svc-container/templates/env.j2' %}
SEMAPHORE_PORT=:{{ container_port }}
SEMAPHORE_WEB_ROOT={{ lookup('tls', application_id, 'url.base') | regex_replace('/+$', '') }}
SEMAPHORE_DB_DIALECT=postgres
SEMAPHORE_DB_HOST={{ lookup('database', application_id, 'host') }}
SEMAPHORE_DB_PORT={{ lookup('database', application_id, 'port') }}
SEMAPHORE_DB_USER={{ lookup('database', application_id, 'username') }}
SEMAPHORE_DB_PASS={{ lookup('database', application_id, 'password') | dotenv_quote }}
SEMAPHORE_DB={{ lookup('database', application_id, 'name') }}
SEMAPHORE_ACCESS_KEY_ENCRYPTION={{ SEMAPHORE_ACCESS_KEY_ENCRYPTION | dotenv_quote }}
SEMAPHORE_COOKIE_HASH={{ SEMAPHORE_COOKIE_HASH | dotenv_quote }}
SEMAPHORE_COOKIE_ENCRYPTION={{ SEMAPHORE_COOKIE_ENCRYPTION | dotenv_quote }}
SEMAPHORE_ADMIN={{ SEMAPHORE_ADMIN_USERNAME }}
SEMAPHORE_ADMIN_PASSWORD={{ SEMAPHORE_ADMIN_PASSWORD | dotenv_quote }}
SEMAPHORE_ADMIN_NAME={{ SEMAPHORE_ADMIN_NAME | dotenv_quote }}
SEMAPHORE_ADMIN_EMAIL={{ SEMAPHORE_ADMIN_EMAIL }}
{% if SEMAPHORE_OIDC_ENABLED | bool %}
SEMAPHORE_OIDC_PROVIDERS={{ SEMAPHORE_OIDC_PROVIDERS_JSON }}
{% endif %}
{% if SEMAPHORE_LDAP_ENABLED | bool %}
SEMAPHORE_LDAP_ENABLE=true
SEMAPHORE_LDAP_NEEDTLS=false
SEMAPHORE_LDAP_SERVER={{ LDAP.SERVER.DOMAIN }}:{{ LDAP.SERVER.PORT }}
SEMAPHORE_LDAP_BIND_DN={{ LDAP.DN.ADMINISTRATOR.DATA | dotenv_quote }}
SEMAPHORE_LDAP_BIND_PASSWORD={{ LDAP.BIND_CREDENTIAL | dotenv_quote }}
SEMAPHORE_LDAP_SEARCH_DN={{ LDAP.DN.OU.USERS | dotenv_quote }}
SEMAPHORE_LDAP_SEARCH_FILTER={{ SEMAPHORE_LDAP_SEARCH_FILTER | dotenv_quote }}
SEMAPHORE_LDAP_MAPPING_DN=dn
SEMAPHORE_LDAP_MAPPING_UID={{ LDAP.USER.ATTRIBUTES.ID }}
SEMAPHORE_LDAP_MAPPING_CN={{ LDAP.USER.ATTRIBUTES.FULLNAME }}
SEMAPHORE_LDAP_MAPPING_MAIL={{ LDAP.USER.ATTRIBUTES.MAIL }}
{% endif %}