forked from CCCHH/ansible-infra
		
	zammad(host): change to .env configuration
Align the compose.yaml to upstreams v11.2.0 version. This is a first step to hopefully then just use the upstreams version directly and not vendor it.
This commit is contained in:
		
					parent
					
						
							
								3840553f9d
							
						
					
				
			
			
				commit
				
					
						747e5b2d4c
					
				
			
		
					 3 changed files with 42 additions and 43 deletions
				
			
		| 
						 | 
				
			
			@ -1,4 +1,5 @@
 | 
			
		|||
docker_compose__compose_file_content: "{{ lookup('ansible.builtin.template', 'resources/chaosknoten/zammad/docker_compose/compose.yaml.j2') }}"
 | 
			
		||||
docker_compose__compose_file_content: "{{ lookup('ansible.builtin.file', 'resources/chaosknoten/zammad/docker_compose/compose.yaml') }}"
 | 
			
		||||
docker_compose__env_file_content: "{{ lookup('ansible.builtin.template', 'resources/chaosknoten/zammad/docker_compose/.env.j2') }}"
 | 
			
		||||
docker_compose__configuration_files: [ ]
 | 
			
		||||
 | 
			
		||||
certbot__version_spec: ""
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										15
									
								
								resources/chaosknoten/zammad/docker_compose/.env.j2
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								resources/chaosknoten/zammad/docker_compose/.env.j2
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,15 @@
 | 
			
		|||
ELASTICSEARCH_VERSION=8.19.4
 | 
			
		||||
IMAGE_REPO=ghcr.io/zammad/zammad
 | 
			
		||||
MEMCACHE_SERVERS=zammad-memcached:11211
 | 
			
		||||
MEMCACHE_VERSION=1.6-alpine
 | 
			
		||||
POSTGRES_DB=zammad_production
 | 
			
		||||
POSTGRES_PASS={{ secret__zammad_db_password }}
 | 
			
		||||
POSTGRES_USER=zammad
 | 
			
		||||
POSTGRES_HOST=zammad-postgresql
 | 
			
		||||
POSTGRES_PORT=5432
 | 
			
		||||
POSTGRES_VERSION=15-alpine
 | 
			
		||||
REDIS_URL=redis://zammad-redis:6379
 | 
			
		||||
REDIS_VERSION=7-alpine
 | 
			
		||||
RESTART=always
 | 
			
		||||
VERSION=6
 | 
			
		||||
NGINX_SERVER_SCHEME=https
 | 
			
		||||
| 
						 | 
				
			
			@ -1,33 +1,16 @@
 | 
			
		|||
---
 | 
			
		||||
{#
 | 
			
		||||
https://github.com/zammad/zammad-docker-compose
 | 
			
		||||
Docker Compose does not allow defining variables in the compose file (only in .env files), so we use Jinja variables instead
 | 
			
		||||
see https://github.com/zammad/zammad-docker-compose/blob/master/.env
 | 
			
		||||
#}
 | 
			
		||||
{%- set ELASTICSEARCH_VERSION = "8.19.4" | quote -%}
 | 
			
		||||
{%- set IMAGE_REPO = "ghcr.io/zammad/zammad" | quote -%}
 | 
			
		||||
{%- set MEMCACHE_SERVERS = "zammad-memcached:11211" | quote -%}
 | 
			
		||||
{%- set MEMCACHE_VERSION = "1.6-alpine" | quote -%}
 | 
			
		||||
{%- set POSTGRES_DB = "zammad_production" | quote -%}
 | 
			
		||||
{%- set POSTGRES_HOST = "zammad-postgresql" | quote -%}
 | 
			
		||||
{%- set POSTGRES_USER = "zammad" | quote -%}
 | 
			
		||||
{%- set POSTGRES_PASS = secret__zammad_db_password | quote -%}
 | 
			
		||||
{%- set POSTGRES_PORT = "5432" | quote -%}
 | 
			
		||||
{%- set POSTGRES_VERSION = "15-alpine" | quote -%}
 | 
			
		||||
{%- set REDIS_URL = "redis://zammad-redis:6379" | quote -%}
 | 
			
		||||
{%- set REDIS_VERSION = "7-alpine" | quote -%}
 | 
			
		||||
{%- set RESTART = "always" | quote -%}
 | 
			
		||||
{%- set VERSION = "6" | quote -%}
 | 
			
		||||
version: '3.8'
 | 
			
		||||
 | 
			
		||||
x-shared:
 | 
			
		||||
  zammad-service: &zammad-service
 | 
			
		||||
    environment: &zammad-environment
 | 
			
		||||
      MEMCACHE_SERVERS: {{ MEMCACHE_SERVERS }}
 | 
			
		||||
      POSTGRESQL_DB: {{ POSTGRES_DB }}
 | 
			
		||||
      POSTGRESQL_HOST: {{ POSTGRES_HOST }}
 | 
			
		||||
      POSTGRESQL_USER: {{ POSTGRES_USER }}
 | 
			
		||||
      POSTGRESQL_PASS: {{ POSTGRES_PASS }}
 | 
			
		||||
      POSTGRESQL_PORT: {{ POSTGRES_PORT }}
 | 
			
		||||
      REDIS_URL: {{ REDIS_URL }}
 | 
			
		||||
      MEMCACHE_SERVERS: ${MEMCACHE_SERVERS}
 | 
			
		||||
      POSTGRESQL_DB: ${POSTGRES_DB}
 | 
			
		||||
      POSTGRESQL_HOST: ${POSTGRES_HOST}
 | 
			
		||||
      POSTGRESQL_USER: ${POSTGRES_USER}
 | 
			
		||||
      POSTGRESQL_PASS: ${POSTGRES_PASS}
 | 
			
		||||
      POSTGRESQL_PORT: ${POSTGRES_PORT}
 | 
			
		||||
      REDIS_URL: ${REDIS_URL}
 | 
			
		||||
      # Allow passing in these variables via .env:
 | 
			
		||||
      AUTOWIZARD_JSON:
 | 
			
		||||
      AUTOWIZARD_RELATIVE_PATH:
 | 
			
		||||
| 
						 | 
				
			
			@ -40,7 +23,7 @@ x-shared:
 | 
			
		|||
      ELASTICSEARCH_SSL_VERIFY:
 | 
			
		||||
      NGINX_PORT:
 | 
			
		||||
      NGINX_SERVER_NAME:
 | 
			
		||||
      NGINX_SERVER_SCHEME: https
 | 
			
		||||
      NGINX_SERVER_SCHEME:
 | 
			
		||||
      POSTGRESQL_DB_CREATE:
 | 
			
		||||
      POSTGRESQL_OPTIONS:
 | 
			
		||||
      RAILS_TRUSTED_PROXIES:
 | 
			
		||||
| 
						 | 
				
			
			@ -48,8 +31,8 @@ x-shared:
 | 
			
		|||
      ZAMMAD_SESSION_JOBS:
 | 
			
		||||
      ZAMMAD_PROCESS_SCHEDULED:
 | 
			
		||||
      ZAMMAD_PROCESS_DELAYED_JOBS_WORKERS:
 | 
			
		||||
    image: {{ IMAGE_REPO }}:{{ VERSION }}
 | 
			
		||||
    restart: {{ RESTART }}
 | 
			
		||||
    image: ${IMAGE_REPO}:${VERSION}
 | 
			
		||||
    restart: ${RESTART}
 | 
			
		||||
    volumes:
 | 
			
		||||
      - zammad-storage:/opt/zammad/storage
 | 
			
		||||
      - zammad-var:/opt/zammad/var
 | 
			
		||||
| 
						 | 
				
			
			@ -71,8 +54,8 @@ services:
 | 
			
		|||
      BACKUP_TIME: "03:00"
 | 
			
		||||
      HOLD_DAYS: "10"
 | 
			
		||||
      TZ: Europe/Berlin
 | 
			
		||||
    image: postgres:{{ POSTGRES_VERSION }}
 | 
			
		||||
    restart: {{ RESTART }}
 | 
			
		||||
    image: postgres:${POSTGRES_VERSION}
 | 
			
		||||
    restart: ${RESTART}
 | 
			
		||||
    volumes:
 | 
			
		||||
      - zammad-backup:/var/tmp/zammad
 | 
			
		||||
      - zammad-storage:/opt/zammad/storage:ro
 | 
			
		||||
| 
						 | 
				
			
			@ -80,8 +63,8 @@ services:
 | 
			
		|||
      - ./scripts/backup.sh:/usr/local/bin/backup.sh:ro
 | 
			
		||||
 | 
			
		||||
  zammad-elasticsearch:
 | 
			
		||||
    image: elasticsearch:{{ ELASTICSEARCH_VERSION }}
 | 
			
		||||
    restart: {{ RESTART }}
 | 
			
		||||
    image: elasticsearch:${ELASTICSEARCH_VERSION}
 | 
			
		||||
    restart: ${RESTART}
 | 
			
		||||
    volumes:
 | 
			
		||||
      - elasticsearch-data:/usr/share/elasticsearch/data
 | 
			
		||||
    environment:
 | 
			
		||||
| 
						 | 
				
			
			@ -102,8 +85,8 @@ services:
 | 
			
		|||
 | 
			
		||||
  zammad-memcached:
 | 
			
		||||
    command: memcached -m 256M
 | 
			
		||||
    image: memcached:{{ MEMCACHE_VERSION }}
 | 
			
		||||
    restart: {{ RESTART }}
 | 
			
		||||
    image: memcached:${MEMCACHE_VERSION}
 | 
			
		||||
    restart: ${RESTART}
 | 
			
		||||
 | 
			
		||||
  zammad-nginx:
 | 
			
		||||
    <<: *zammad-service
 | 
			
		||||
| 
						 | 
				
			
			@ -119,11 +102,11 @@ services:
 | 
			
		|||
 | 
			
		||||
  zammad-postgresql:
 | 
			
		||||
    environment:
 | 
			
		||||
      POSTGRES_DB: {{ POSTGRES_DB }}
 | 
			
		||||
      POSTGRES_USER: {{ POSTGRES_USER }}
 | 
			
		||||
      POSTGRES_PASSWORD: {{ POSTGRES_PASS }}
 | 
			
		||||
    image: postgres:{{ POSTGRES_VERSION }}
 | 
			
		||||
    restart: {{ RESTART }}
 | 
			
		||||
      POSTGRES_DB: ${POSTGRES_DB}
 | 
			
		||||
      POSTGRES_USER: ${POSTGRES_USER}
 | 
			
		||||
      POSTGRES_PASSWORD: ${POSTGRES_PASS}
 | 
			
		||||
    image: postgres:${POSTGRES_VERSION}
 | 
			
		||||
    restart: ${RESTART}
 | 
			
		||||
    volumes:
 | 
			
		||||
      - postgresql-data:/var/lib/postgresql/data
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -132,8 +115,8 @@ services:
 | 
			
		|||
    command: ["zammad-railsserver"]
 | 
			
		||||
 | 
			
		||||
  zammad-redis:
 | 
			
		||||
    image: redis:{{ REDIS_VERSION }}
 | 
			
		||||
    restart: {{ RESTART }}
 | 
			
		||||
    image: redis:${REDIS_VERSION}
 | 
			
		||||
    restart: ${RESTART}
 | 
			
		||||
    volumes:
 | 
			
		||||
      - redis-data:/data
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue