-
Notifications
You must be signed in to change notification settings - Fork 114
Add ticketsystem playbook #2143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
1898c1d
2b731b9
cb8c9bd
f302219
0e73553
0e55240
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| hostname: "ticketsystem.{{ tailscale_domain }}" | ||
| zammad_compose_dir: /opt/zammad-docker-compose | ||
| zammad_compose_version: a1feeee | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| docker_service_enabled: true | ||
| software_groups_to_install: | ||
| - admin | ||
| - editors | ||
| - utils | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,3 +114,6 @@ sn12.galaxyproject.eu | |
|
|
||
| [osiris] | ||
| osiris.denbi.de ansible_ssh_user=rocky | ||
|
|
||
| [ticketsystem] | ||
| ticketsystem.bi.privat | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,209 @@ | ||
| --- | ||
| # This is copied from https://github.com/zammad/zammad-docker-compose.git | ||
| # Based on a1feeee 🏷 v15.2.0 | ||
| x-shared: | ||
| zammad-service: &zammad-service | ||
| environment: &zammad-environment | ||
| MEMCACHE_SERVERS: ${MEMCACHE_SERVERS:-zammad-memcached:11211} | ||
| POSTGRESQL_DB: ${POSTGRES_DB:-zammad_production} | ||
| POSTGRESQL_HOST: ${POSTGRES_HOST:-zammad-postgresql} | ||
| POSTGRESQL_USER: ${POSTGRES_USER:-zammad} | ||
| POSTGRESQL_PASS: ${POSTGRES_PASS:-zammad} | ||
| POSTGRESQL_PORT: ${POSTGRES_PORT:-5432} | ||
| POSTGRESQL_OPTIONS: ${POSTGRESQL_OPTIONS:-?pool=50} | ||
| POSTGRESQL_DB_CREATE: | ||
|
|
||
| # Redis standalone | ||
| REDIS_URL: ${REDIS_URL:-redis://zammad-redis:6379} | ||
| # Redis sentinel | ||
| REDIS_SENTINELS: | ||
| REDIS_SENTINEL_NAME: | ||
| REDIS_USERNAME: | ||
| REDIS_PASSWORD: | ||
| REDIS_SENTINEL_USERNAME: | ||
| REDIS_SENTINEL_PASSWORD: | ||
|
|
||
| S3_URL: | ||
| # Backup settings | ||
| BACKUP_DIR: "${BACKUP_DIR:-/var/tmp/zammad}" | ||
| BACKUP_TIME: "${BACKUP_TIME:-03:00}" | ||
| HOLD_DAYS: "${HOLD_DAYS:-10}" | ||
| TZ: "${TZ:-Europe/Berlin}" | ||
| # Allow passing in these variables via .env: | ||
| AUTOWIZARD_JSON: | ||
| AUTOWIZARD_RELATIVE_PATH: | ||
| ELASTICSEARCH_ENABLED: | ||
| ELASTICSEARCH_SCHEMA: | ||
| ELASTICSEARCH_HOST: | ||
| ELASTICSEARCH_PORT: | ||
| ELASTICSEARCH_USER: | ||
| ELASTICSEARCH_PASS: | ||
| ELASTICSEARCH_NAMESPACE: | ||
| ELASTICSEARCH_REINDEX: | ||
| NGINX_PORT: | ||
| NGINX_CLIENT_MAX_BODY_SIZE: | ||
| NGINX_SERVER_NAME: | ||
| NGINX_SERVER_SCHEME: | ||
| RAILS_TRUSTED_PROXIES: | ||
| ZAMMAD_HTTP_TYPE: | ||
| ZAMMAD_FQDN: {{ hostname }} | ||
| ZAMMAD_WEB_CONCURRENCY: | ||
| ZAMMAD_MANAGE_SESSIONS_JOBS_WORKERS: | ||
| ZAMMAD_PROCESS_SESSIONS_JOBS_WORKERS: | ||
| ZAMMAD_PROCESS_SCHEDULED_JOBS_WORKERS: | ||
| ZAMMAD_PROCESS_DELAYED_JOBS_WORKERS: | ||
| ZAMMAD_PROCESS_DELAYED_JOBS_WORKER_THREADS: | ||
| ZAMMAD_PROCESS_DELAYED_AI_JOBS_WORKERS: | ||
| ZAMMAD_PROCESS_DELAYED_AI_JOBS_WORKER_THREADS: | ||
| ZAMMAD_PROCESS_DELAYED_COMMUNICATION_INBOUND_JOBS_WORKERS: | ||
| ZAMMAD_PROCESS_DELAYED_COMMUNICATION_INBOUND_JOBS_WORKER_THREADS: | ||
| ZAMMAD_OTRS_IMPORT_READ_TIMEOUT: | ||
| ZAMMAD_OTRS_IMPORT_TOTAL_TIMEOUT: | ||
|
|
||
| # ZAMMAD_SESSION_JOBS_CONCURRENT is deprecated, please use ZAMMAD_PROCESS_SESSIONS_JOBS_WORKERS instead. | ||
| ZAMMAD_SESSION_JOBS_CONCURRENT: | ||
| # Variables used by ngingx-proxy container for reverse proxy creations | ||
| # for docs refer to https://github.com/nginx-proxy/nginx-proxy | ||
| VIRTUAL_HOST: | ||
| VIRTUAL_PORT: | ||
| # Variables used by acme-companion for retrieval of LetsEncrypt certificate | ||
| # for docs refer to https://github.com/nginx-proxy/acme-companion | ||
| LETSENCRYPT_HOST: | ||
| LETSENCRYPT_EMAIL: | ||
|
|
||
| image: ${IMAGE_REPO:-ghcr.io/zammad/zammad}:${VERSION:-7.0.0-0042} | ||
| restart: ${RESTART:-always} | ||
| volumes: | ||
| - zammad-backup:/var/tmp/zammad:ro # needed for waiting on restore operations | ||
| - zammad-storage:/opt/zammad/storage | ||
| depends_on: | ||
| - zammad-memcached | ||
| - zammad-postgresql | ||
| - zammad-redis | ||
|
|
||
| services: | ||
| zammad-backup: | ||
| <<: *zammad-service | ||
| command: ["zammad-backup"] | ||
| volumes: | ||
| - zammad-backup:/var/tmp/zammad | ||
| - zammad-storage:/opt/zammad/storage | ||
| user: 0:0 | ||
|
|
||
| zammad-elasticsearch: | ||
| image: elasticsearch:${ELASTICSEARCH_VERSION:-9.3.2} | ||
| restart: ${RESTART:-always} | ||
| volumes: | ||
| - elasticsearch-data:/usr/share/elasticsearch/data | ||
| environment: | ||
| discovery.type: single-node | ||
| xpack.security.enabled: 'false' | ||
| ES_JAVA_OPTS: ${ELASTICSEARCH_JAVA_OPTS:--Xms1g -Xmx1g} | ||
|
|
||
| zammad-init: | ||
| <<: *zammad-service | ||
| command: ["zammad-init"] | ||
| depends_on: | ||
| - zammad-postgresql | ||
| restart: on-failure | ||
| user: 0:0 | ||
|
|
||
| zammad-memcached: | ||
| command: memcached -m 256M | ||
| image: memcached:${MEMCACHE_VERSION:-1.6.41-alpine} | ||
| restart: ${RESTART:-always} | ||
|
|
||
| zammad-nginx: | ||
| <<: *zammad-service | ||
| command: ["zammad-nginx"] | ||
| expose: | ||
| - "${NGINX_PORT:-8080}" | ||
| depends_on: | ||
| - zammad-railsserver | ||
| networks: | ||
| - default | ||
| - traefik | ||
| labels: | ||
| - "traefik.enable=true" | ||
| - "traefik.http.routers.zammad.rule=Host(`{{ hostname }}`)" | ||
| - "traefik.http.routers.zammad.entrypoints=websecure" | ||
| - "traefik.http.routers.zammad.tls=true" | ||
| - "traefik.http.routers.zammad.tls.certresolver=ts" | ||
| - "traefik.http.routers.zammad.tls.domains[0].main={{ hostname }}" | ||
| - "traefik.http.routers.zammad.service=zammad-app" | ||
| - "traefik.http.services.zammad-app.loadbalancer.server.port=${NGINX_PORT:-8080}" | ||
|
|
||
| zammad-postgresql: | ||
| environment: | ||
| POSTGRES_DB: ${POSTGRES_DB:-zammad_production} | ||
| POSTGRES_USER: ${POSTGRES_USER:-zammad} | ||
| POSTGRES_PASSWORD: ${POSTGRES_PASS:-zammad} | ||
| image: postgres:${POSTGRES_VERSION:-17.9-alpine} | ||
| restart: ${RESTART:-always} | ||
| volumes: | ||
| - postgresql-data:/var/lib/postgresql/data | ||
|
|
||
| zammad-railsserver: | ||
| <<: *zammad-service | ||
| command: ["zammad-railsserver"] | ||
|
|
||
| zammad-redis: | ||
| image: redis:${REDIS_VERSION:-8.6.1-alpine} | ||
| restart: ${RESTART:-always} | ||
| volumes: | ||
| - redis-data:/data | ||
|
|
||
| zammad-scheduler: | ||
| <<: *zammad-service | ||
| command: ["zammad-scheduler"] | ||
|
|
||
| zammad-websocket: | ||
| <<: *zammad-service | ||
| command: ["zammad-websocket"] | ||
|
|
||
| traefik: | ||
| image: traefik:v3.7.0 | ||
| restart: ${RESTART:-always} | ||
| command: | ||
| - --ping | ||
| - --ping.entryPoint=websecure | ||
| - --api=true | ||
| - --api.dashboard=false | ||
| - --api.insecure=false | ||
| - --global.sendAnonymousUsage=false | ||
| - --global.checkNewVersion=false | ||
| - --entryPoints.websecure.address=:443 | ||
| - --entryPoints.websecure.http.tls=true | ||
| - --providers.docker=true | ||
| - --providers.docker.exposedByDefault=false | ||
| - --providers.docker.network=zammad-docker-compose_traefik | ||
| - --certificatesResolvers.ts.tailscale=true | ||
| - --log.level=INFO | ||
| - --accesslog=true | ||
| labels: | ||
| - "traefik.enable=false" | ||
| ports: | ||
| - "443:443" | ||
| networks: | ||
| - traefik | ||
| volumes: | ||
| - /var/run/docker.sock:/var/run/docker.sock:ro | ||
| - /var/run/tailscale:/var/run/tailscale:ro | ||
| security_opt: | ||
| - "label:type:container_runtime_t" | ||
|
|
||
| networks: | ||
| traefik: | ||
| driver: bridge | ||
|
|
||
| volumes: | ||
| elasticsearch-data: | ||
| driver: local | ||
| postgresql-data: | ||
| driver: local | ||
| redis-data: | ||
| driver: local | ||
| zammad-backup: | ||
| driver: local | ||
| zammad-storage: | ||
| driver: local |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| --- | ||
| - name: Ticket System with Traefik and Zammad | ||
| become: true | ||
| hosts: ticketsystem | ||
| vars_files: | ||
| - secret_group_vars/all.yml | ||
| - group_vars/ticket_system.yml | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am aware you prefer to specify which files to load because you find it easier to track it this way. To me it feels like "swimming against a current" (the Ansible design) for not much benefit in exchange. Therefore it comes with downsides (e.g. why did I add another playbook/play for "mygroup" and it's not behaving like other playbooks for "mygroup"?, repeat for every play/playbook, etc). If you happen to have "room" (and will) for internalizing the part of the variable precedence rules "group vars rule files/directories named after a group are automatically loaded for that group" that's welcome. I won't nag you about this again for a couple of months.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this rule and I also try to use it, pinky promise 😌 |
||
|
|
||
| pre_tasks: | ||
| - name: Install Ansible dependencies | ||
| ansible.builtin.package: | ||
| name: | ||
| - python3-policycoreutils | ||
| - python3-libselinux | ||
| - policycoreutils-python-utils | ||
| - python3-pip | ||
| state: present | ||
|
|
||
| - name: Install python docker | ||
| become: true | ||
| ansible.builtin.pip: | ||
| name: "{{ item }}" | ||
| virtualenv_command: "python3 -m venv" | ||
| loop: | ||
| - docker | ||
| - selinux | ||
|
|
||
| roles: | ||
| - geerlingguy.repo-epel | ||
| - role: usegalaxy_eu.handy.os_setup | ||
| vars: | ||
| enable_hostname: true | ||
| enable_powertools: false | ||
| enable_remap_user: false | ||
| enable_exclude_packages: true | ||
| enable_pam_limits: true | ||
| enable_install_software: true | ||
| - artis3n.tailscale | ||
| - geerlingguy.docker | ||
| - usegalaxy_eu.firewall | ||
|
|
||
| tasks: | ||
| - name: Ensure Zammad compose directory exists | ||
| ansible.builtin.file: | ||
| path: "{{ zammad_compose_dir }}" | ||
| state: directory | ||
| owner: root | ||
| group: root | ||
| mode: '0755' | ||
|
|
||
| - name: Clone zammad-docker-compose repository | ||
| ansible.builtin.git: | ||
| repo: "https://github.com/zammad/zammad-docker-compose.git" | ||
| dest: "{{ zammad_compose_dir }}" | ||
| version: "{{ zammad_compose_version }}" | ||
| force: false | ||
|
|
||
| - name: Template Docker Compose file | ||
| ansible.builtin.template: | ||
| src: ticket_system/docker_compose.yml.j2 | ||
| dest: "{{ zammad_compose_dir }}/docker-compose.yml" | ||
| owner: root | ||
| group: root | ||
| mode: '0644' | ||
| register: zammad_compose_templated | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is something I don't quite get: We are providing the Docker Compose file ourselves via the "Template Docker Compose file" task, and I do not see anything else of value in the Zammad repo (the |
||
|
|
||
| - name: Start Zammad services | ||
| community.docker.docker_compose_v2: | ||
| project_src: "{{ zammad_compose_dir }}" | ||
| state: present | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this compatible with #2173?