Refactor everything

This commit is contained in:
Tobias Reisinger 2023-12-14 02:20:13 +01:00
parent 2e100d290f
commit 3f2e60becf
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
69 changed files with 366 additions and 281 deletions

View file

@ -1,2 +0,0 @@
skip_list:
- var-naming[no-role-prefix]

View file

@ -7,6 +7,8 @@
hosts: local-dev hosts: local-dev
roles: roles:
- common
- acme-dns - acme-dns
- coder - coder
- faas - faas

View file

@ -2,5 +2,9 @@
- name: Run roles for node001 - name: Run roles for node001
hosts: node001 hosts: node001
roles: roles:
- mailcow - common
- minecraft-2
- role: mailcow
tags: [mailcow, mail, communication]
- role: minecraft_2
tags: [minecraft-2, minecraft, games]

View file

@ -2,24 +2,47 @@
- name: Run roles for node002 - name: Run roles for node002
hosts: node002 hosts: node002
roles: roles:
- acme-dns - common
- authentik
- coder - role: acme_dns
- faas tags: [acme-dns, certificates]
- forgejo - role: authentik
- forgejo-runner tags: [authentik, authentication]
- harbor - role: coder
- healthcheck tags: [coder, development]
- homebox - role: faas
- influxdb tags: [faas]
- jellyfin - role: forgejo
- synapse tags: [forgejo, git, development]
- tandoor - role: forgejo_runner
- telegraf tags: [forgejo-runner, ci, development]
- tinytinyrss - role: harbor
- umami tags: [harbor, registry, development]
- uptime-kuma - role: healthcheck
- watchtower tags: [healthcheck, monitoring]
- webdis - role: homebox
- wiki-js tags: [homebox, inventory]
- woodpecker - role: influxdb
tags: [influxdb, sensors, monitoring]
- role: jellyfin
tags: [jellyfin, media]
- role: synapse
tags: [synapse, matrix, communication]
- role: tandoor
tags: [tandoor, recipes]
- role: telegraf
tags: [telegraf, monitoring]
- role: tinytinyrss
tags: [tinytinyrss, news]
- role: umami
tags: [umami, analytics]
- role: uptime_kuma
tags: [uptime-kuma, monitoring]
- role: watchtower
tags: [watchtower]
- role: webdis
tags: [webdis]
- role: wiki_js
tags: [wiki-js]
- role: woodpecker
tags: [woodpecker, ci, development]

View file

@ -2,4 +2,7 @@
- name: Run roles for node003 - name: Run roles for node003
hosts: node003 hosts: node003
roles: roles:
- minio - common
- role: minio
tags: [minio, storage]

View file

@ -1,8 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- acme-dns svc: "{{ acme_dns_svc }}"
- certificates env: "{{ acme_dns_env }}"
compose: "{{ acme_dns_compose }}"
block: block:
- name: Import prepare tasks for common service - name: Import prepare tasks for common service
ansible.builtin.import_tasks: tasks/prepare-common-service.yml ansible.builtin.import_tasks: tasks/prepare-common-service.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: acme_dns_svc:
domain: acme.serguzim.me domain: acme.serguzim.me
name: acme-dns name: acme-dns
port: 80 port: 80
@ -13,7 +13,7 @@ svc:
pass: "{{ vault_acmedns.db.pass }}" pass: "{{ vault_acmedns.db.pass }}"
db: acme_dns db: acme_dns
compose: acme_dns_compose:
watchtower: true watchtower: true
monitoring: true monitoring: true
image: joohoi/acme-dns image: joohoi/acme-dns

View file

@ -1,8 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- authentik svc: "{{ authentik_svc }}"
- authentication env: "{{ authentik_env }}"
compose: "{{ authentik_compose }}"
block: block:
- name: Import tasks to deploy common service - name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: authentik_svc:
domain: auth.serguzim.me domain: auth.serguzim.me
name: authentik name: authentik
port: 9000 port: 9000
@ -10,7 +10,7 @@ svc:
user: "{{ vault_authentik.db.user }}" user: "{{ vault_authentik.db.user }}"
pass: "{{ vault_authentik.db.pass }}" pass: "{{ vault_authentik.db.pass }}"
svc_env: authentik_env:
AUTHENTIK_SECRET_KEY: "{{ vault_authentik.secret_key }}" AUTHENTIK_SECRET_KEY: "{{ vault_authentik.secret_key }}"
AUTHENTIK_EMAIL__HOST: "{{ mailer.host }}" AUTHENTIK_EMAIL__HOST: "{{ mailer.host }}"
@ -31,10 +31,9 @@ svc_env:
AUTHENTIK_POSTGRESQL__USER: "{{ svc.db.user }}" AUTHENTIK_POSTGRESQL__USER: "{{ svc.db.user }}"
AUTHENTIK_POSTGRESQL__PASSWORD: "{{ svc.db.pass }}" AUTHENTIK_POSTGRESQL__PASSWORD: "{{ svc.db.pass }}"
compose: authentik_compose:
watchtower: false watchtower: false
image: ghcr.io/goauthentik/server:{{ svc.image_tag }} image: ghcr.io/goauthentik/server:{{ svc.image_tag }}
env: true
file: file:
services: services:
app: app:

View file

@ -1,9 +1,13 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }}
vars:
svc: "{{ caddy_svc }}"
env: "{{ caddy_env }}"
compose: "{{ caddy_compose }}"
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags:
- caddy
- reverse_proxy
- webserver
block: block:
- name: Import tasks to deploy common service - name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,7 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- coder svc: "{{ coder_svc }}"
env: "{{ coder_env }}"
compose: "{{ coder_compose }}"
block: block:
- name: Import tasks to deploy common service - name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: coder_svc:
domain: coder.serguzim.me domain: coder.serguzim.me
additional_domains: additional_domains:
- "*.coder.serguzim.me" - "*.coder.serguzim.me"
@ -12,7 +12,7 @@ svc:
ssh_port: 22 ssh_port: 22
ssh_port_alt: 3022 ssh_port_alt: 3022
svc_env: coder_env:
CODER_ADDRESS: "0.0.0.0:7080" CODER_ADDRESS: "0.0.0.0:7080"
CODER_ACCESS_URL: https://{{ svc.domain }} CODER_ACCESS_URL: https://{{ svc.domain }}
CODER_WILDCARD_ACCESS_URL: "*.{{ svc.domain }}" CODER_WILDCARD_ACCESS_URL: "*.{{ svc.domain }}"
@ -23,10 +23,9 @@ svc_env:
CODER_OIDC_CLIENT_ID: "{{ vault_coder.oidc_client.id }}" CODER_OIDC_CLIENT_ID: "{{ vault_coder.oidc_client.id }}"
CODER_OIDC_CLIENT_SECRET: "{{ vault_coder.oidc_client.secret }}" CODER_OIDC_CLIENT_SECRET: "{{ vault_coder.oidc_client.secret }}"
compose: coder_compose:
watchtower: true watchtower: true
image: ghcr.io/coder/coder:latest image: ghcr.io/coder/coder:latest
env: true
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
file: file:

View file

@ -0,0 +1,7 @@
---
- name: Reload caddy
ansible.builtin.command:
cmd: docker compose exec app sh -c "caddy validate --config /etc/caddy/Caddyfile && caddy reload --config /etc/caddy/Caddyfile"
chdir: "{{ caddy_path }}"
when: "'local-dev' != inventory_hostname"
changed_when: true

View file

@ -1,7 +1,10 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- faas svc: "{{ faas_svc }}"
block: block:
- name: Import tasks to template the site and functions for the reverse proxy - name: Import tasks to template the site and functions for the reverse proxy
ansible.builtin.import_tasks: tasks/steps/template-site-config.yml ansible.builtin.import_tasks: tasks/steps/template-site-config.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: faas_svc:
name: faas name: faas
domain: faas.serguzim.me domain: faas.serguzim.me
docker_host: host.docker.internal docker_host: host.docker.internal

View file

@ -1,8 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- forgejo svc: "{{ forgejo_svc }}"
- git env: "{{ forgejo_env }}"
compose: "{{ forgejo_compose }}"
block: block:
- name: Import tasks to deploy common service - name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: forgejo_svc:
domain: git.serguzim.me domain: git.serguzim.me
name: forgejo name: forgejo
port: 3000 port: 3000
@ -10,7 +10,7 @@ svc:
ssh_port: 22 ssh_port: 22
ssh_port_alt: 3022 ssh_port_alt: 3022
svc_env: forgejo_env:
FORGEJO__database__DB_TYPE: postgres FORGEJO__database__DB_TYPE: postgres
FORGEJO__database__HOST: "{{ svc.db.host }}:{{ svc.db.port }}" FORGEJO__database__HOST: "{{ svc.db.host }}:{{ svc.db.port }}"
FORGEJO__database__NAME: forgejo FORGEJO__database__NAME: forgejo
@ -78,10 +78,9 @@ svc_env:
FORGEJO__other__SHOW_FOOTER_VERSION: true FORGEJO__other__SHOW_FOOTER_VERSION: true
FORGEJO__other__SHOW_FOOTER_TEMPLATE_LOAD_TIME: false FORGEJO__other__SHOW_FOOTER_TEMPLATE_LOAD_TIME: false
compose: forgejo_compose:
watchtower: true watchtower: true
image: codeberg.org/forgejo/forgejo:1.21 image: codeberg.org/forgejo/forgejo:1.21
env: true
volumes: volumes:
- data:/data - data:/data
- /etc/timezone:/etc/timezone:ro - /etc/timezone:/etc/timezone:ro

View file

@ -1,10 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- git svc: "{{ forgejo_runner_svc }}"
- forgejo env: "{{ forgejo_runner_env }}"
- ci compose: "{{ forgejo_runner_compose }}"
- forgejo-runner
block: block:
- name: Import tasks to create service directory - name: Import tasks to create service directory
ansible.builtin.import_tasks: tasks/steps/create-service-directory.yml ansible.builtin.import_tasks: tasks/steps/create-service-directory.yml
@ -20,11 +22,11 @@
- name: Check if service.env already exists - name: Check if service.env already exists
ansible.builtin.stat: ansible.builtin.stat:
path: "{{ (service_path, 'service.env') | path_join }}" path: "{{ (service_path, 'service.env') | path_join }}"
register: svc_env_file register: env_file
- name: Import tasks to prompt for the registration token - name: Import tasks to prompt for the registration token
ansible.builtin.import_tasks: tasks/prompt-registration-token.yml ansible.builtin.import_tasks: tasks/prompt-registration-token.yml
when: not svc_env_file.stat.exists or force_forgejo_runner_registration | default(False) when: not env_file.stat.exists or force_forgejo_runner_registration | default(False)
- name: Import tasks create a service.env file - name: Import tasks create a service.env file
ansible.builtin.import_tasks: tasks/steps/template-service-env.yml ansible.builtin.import_tasks: tasks/steps/template-service-env.yml
@ -36,5 +38,5 @@
cmd: docker compose run --rm -it app sh -c cmd: docker compose run --rm -it app sh -c
'forgejo-runner register --no-interactive --token ${FORGEJO_RUNNER_REGISTRATION_TOKEN} --instance ${FORGEJO_INSTANCE_URL}' 'forgejo-runner register --no-interactive --token ${FORGEJO_RUNNER_REGISTRATION_TOKEN} --instance ${FORGEJO_INSTANCE_URL}'
chdir: "{{ service_path }}" chdir: "{{ service_path }}"
when: not svc_env_file.stat.exists or force_forgejo_runner_registration | default(False) when: not env_file.stat.exists or force_forgejo_runner_registration | default(False)
changed_when: true # "when" checks enough. We are sure to change something here. changed_when: true # "when" checks enough. We are sure to change something here.

View file

@ -7,4 +7,4 @@
- name: Put registration token into env vars - name: Put registration token into env vars
ansible.builtin.set_fact: ansible.builtin.set_fact:
svc_env: "{{ svc_env | combine({'FORGEJO_RUNNER_REGISTRATION_TOKEN': promt_registration_token.user_input}, recursive=True) }}" forgejo_runner_env: "{{ forgejo_runner_env | combine({'FORGEJO_RUNNER_REGISTRATION_TOKEN': promt_registration_token.user_input}, recursive=True) }}"

View file

@ -1,16 +1,15 @@
--- ---
svc: forgejo_runner_svc:
name: forgejo-runner name: forgejo-runner
svc_env: forgejo_runner_env:
FORGEJO_INSTANCE_URL: https://git.serguzim.me/ FORGEJO_INSTANCE_URL: https://git.serguzim.me/
FORGEJO_RUNNER_REGISTRATION_TOKEN: FORGEJO_RUNNER_REGISTRATION_TOKEN:
DOCKER_HOST: tcp://docker-in-docker:2375 DOCKER_HOST: tcp://docker-in-docker:2375
compose: forgejo_runner_compose:
watchtower: true watchtower: true
image: code.forgejo.org/forgejo/runner:3.3.0 image: code.forgejo.org/forgejo/runner:3.3.0
env: true
volumes: volumes:
- ./config.yml:/config/config.yml - ./config.yml:/config/config.yml
- data:/data - data:/data

View file

@ -1,22 +0,0 @@
version: 1
formatters:
precise:
format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s'
handlers:
console:
class: logging.StreamHandler
formatter: precise
loggers:
synapse.storage.SQL:
# beware: increasing this to DEBUG will make synapse log sensitive
# information such as access tokens.
level: INFO
root:
level: INFO
handlers: [console]
disable_existing_loggers: false

View file

@ -1,8 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- harbor svc: "{{ harbor_svc }}"
- registry env: "{{ harbor_env }}"
yml: "{{ harbor_yml }}"
block: block:
- name: Import prepare tasks for common service - name: Import prepare tasks for common service
ansible.builtin.import_tasks: tasks/prepare-common-service.yml ansible.builtin.import_tasks: tasks/prepare-common-service.yml

View file

@ -1,16 +1,21 @@
--- ---
svc_ports: harbor_port_http: 20080
http: 20080 harbor_port_https: 20443
https: 20443 harbor_port_metrics: 29000
metrics: 29000
svc: harbor_db_host: "{{ postgres.host }}"
harbor_db_port: "{{ postgres.port }}"
harbor_db_database: harbor
harbor_db_user: "{{ vault_harbor.db.user }}"
harbor_db_pass: "{{ vault_harbor.db.pass }}"
harbor_version: 2.9.0
harbor_svc:
name: harbor name: harbor
no_compose: true # TODO remove when fixing "var-naming[no-role-prefix]"
domain: registry.serguzim.me domain: registry.serguzim.me
caddy_extra: | caddy_extra: |
reverse_proxy /metrics host.docker.internal:{{ svc_ports.metrics }} reverse_proxy /metrics host.docker.internal:{{ harbor_port_metrics }}
reverse_proxy host.docker.internal:{{ svc_ports.https }} { reverse_proxy host.docker.internal:{{ harbor_port_https }} {
transport http { transport http {
tls tls
tls_server_name registry.serguzim.me tls_server_name registry.serguzim.me
@ -25,12 +30,12 @@ svc:
pass: "{{ vault_harbor.db.pass }}" pass: "{{ vault_harbor.db.pass }}"
harbor_version: 2.9.0 harbor_version: 2.9.0
svc_yml: harbor_yml:
hostname: "{{ svc.domain }}" hostname: "{{ harbor_svc.domain }}"
http: http:
port: "{{ svc_ports.http }}" port: "{{ harbor_port_http }}"
https: https:
port: "{{ svc_ports.https }}" port: "{{ harbor_port_https }}"
certificate: /opt/services/.lego/certificates/registry.serguzim.me.crt certificate: /opt/services/.lego/certificates/registry.serguzim.me.crt
private_key: /opt/services/.lego/certificates/registry.serguzim.me.key private_key: /opt/services/.lego/certificates/registry.serguzim.me.key
external_url: https://registry.serguzim.me external_url: https://registry.serguzim.me
@ -65,14 +70,14 @@ svc_yml:
rotate_count: 50 rotate_count: 50
rotate_size: 200M rotate_size: 200M
location: /var/log/harbor location: /var/log/harbor
_version: "{{ svc.harbor_version }}" _version: "{{ harbor_version }}"
external_database: external_database:
harbor: harbor:
host: "{{ svc.db.host }}" host: "{{ harbor_db_host }}"
port: "{{ svc.db.port }}" port: "{{ harbor_db_port }}"
db_name: "{{ svc.db.database }}" db_name: "{{ harbor_db_database }}"
username: "{{ svc.db.user }}" username: "{{ harbor_db_user }}"
password: "{{ svc.db.pass }}" password: "{{ harbor_db_pass }}"
ssl_mode: verify-full ssl_mode: verify-full
max_idle_conns: 2 max_idle_conns: 2
max_open_conns: 0 max_open_conns: 0
@ -86,7 +91,7 @@ svc_yml:
- trivy - trivy
metric: metric:
enabled: enabled enabled: enabled
port: "{{ svc_ports.metrics }}" port: "{{ harbor_port_metrics }}"
path: /metrics path: /metrics
upload_purging: upload_purging:
enabled: true enabled: true

View file

@ -1,7 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- healthcheck svc: "{{ healthcheck_svc }}"
env: "{{ healthcheck_env }}"
compose: "{{ healthcheck_compose }}"
block: block:
- name: Import tasks to create service directory - name: Import tasks to create service directory
ansible.builtin.import_tasks: tasks/steps/create-service-directory.yml ansible.builtin.import_tasks: tasks/steps/create-service-directory.yml

View file

@ -1,8 +1,8 @@
--- ---
svc: healthcheck_svc:
name: healthcheck name: healthcheck
svc_env: healthcheck_env:
USER_AGENT: healthcheck-bot for serguzim.net USER_AGENT: healthcheck-bot for serguzim.net
HTTP_HC_UID: "{{ vault_healthcheck.hc_uid.http }}" HTTP_HC_UID: "{{ vault_healthcheck.hc_uid.http }}"

View file

@ -1,8 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- homebox svc: "{{ homebox_svc }}"
- inventory env: "{{ homebox_env }}"
compose: "{{ homebox_compose }}"
block: block:
- name: Import tasks to deploy common service - name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,10 +1,10 @@
--- ---
svc: homebox_svc:
domain: inventory.serguzim.me domain: inventory.serguzim.me
name: homebox name: homebox
port: 7745 port: 7745
svc_env: homebox_env:
HBOX_OPTIONS_ALLOW_REGISTRATION: false HBOX_OPTIONS_ALLOW_REGISTRATION: false
HBOX_MAILER_HOST: mail.serguzim.me HBOX_MAILER_HOST: mail.serguzim.me
HBOX_MAILER_PORT: 587 HBOX_MAILER_PORT: 587
@ -13,10 +13,9 @@ svc_env:
HBOX_MAILER_FROM: Homebox <inventory@serguzim.me> HBOX_MAILER_FROM: Homebox <inventory@serguzim.me>
HBOX_SWAGGER_SCHEMA: https HBOX_SWAGGER_SCHEMA: https
compose: homebox_compose:
watchtower: true watchtower: true
image: ghcr.io/hay-kot/homebox:latest-rootless image: ghcr.io/hay-kot/homebox:latest-rootless
env: true
volumes: volumes:
- data:/data - data:/data
file: file:

View file

@ -1,8 +1,13 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- influxdb svc: "{{ influxdb_svc }}"
- sensors env: "{{ influxdb_env }}"
compose: "{{ influxdb_compose }}"
yml: "{{ influxdb_yml }}"
block: block:
- name: Import prepare tasks for common service - name: Import prepare tasks for common service
ansible.builtin.import_tasks: tasks/prepare-common-service.yml ansible.builtin.import_tasks: tasks/prepare-common-service.yml

View file

@ -1,11 +1,11 @@
--- ---
svc: influxdb_svc:
domain: tick.serguzim.me domain: tick.serguzim.me
name: influxdb name: influxdb
port: 8086 port: 8086
data_dir: /var/lib/influxdb2 data_dir: /var/lib/influxdb2
svc_yml: influxdb_yml:
assets-path: "" assets-path: ""
bolt-path: "{{ (svc.data_dir, 'influxd.bolt') | path_join }}" bolt-path: "{{ (svc.data_dir, 'influxd.bolt') | path_join }}"
e2e-testing: false e2e-testing: false
@ -62,7 +62,7 @@ svc_yml:
vault-tls-server-name: "" vault-tls-server-name: ""
vault-token: "" vault-token: ""
compose: influxdb_compose:
watchtower: false watchtower: false
image: influxdb:2.7 image: influxdb:2.7
volumes: volumes:

View file

@ -1,8 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- jellyfin svc: "{{ jellyfin_svc }}"
- media env: "{{ jellyfin_env }}"
compose: "{{ jellyfin_compose }}"
block: block:
- name: Import tasks to deploy common service - name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: jellyfin_svc:
domain: media.serguzim.me domain: media.serguzim.me
name: jellyfin name: jellyfin
port: 8096 port: 8096
@ -7,13 +7,12 @@ svc:
host: "{{ postgres.host }}" host: "{{ postgres.host }}"
port: "{{ postgres.port }}" port: "{{ postgres.port }}"
svc_env: jellyfin_env:
JELLYFIN_PublishedServerUrl: https://{{ svc.domain }} JELLYFIN_PublishedServerUrl: https://{{ svc.domain }}
compose: jellyfin_compose:
watchtower: true watchtower: true
image: jellyfin/jellyfin image: jellyfin/jellyfin
env: true
volumes: volumes:
- config:/config - config:/config
- cache:/cache - cache:/cache

View file

@ -1,8 +1,10 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- mailcow svc: "{{ mailcow_svc }}"
- email
block: block:
- name: Import tasks to template the site for the reverse proxy - name: Import tasks to template the site for the reverse proxy
ansible.builtin.import_tasks: tasks/steps/template-site-config.yml ansible.builtin.import_tasks: tasks/steps/template-site-config.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: mailcow_svc:
name: mailcow name: mailcow
domain: mail.serguzim.me domain: mail.serguzim.me
docker_host: host.docker.internal docker_host: host.docker.internal

View file

@ -1,9 +0,0 @@
---
- name: Deploy {{ svc.name }}
tags:
- minecraft-2
- minecraft
- games
block:
- name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -0,0 +1,12 @@
---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }}
vars:
svc: "{{ minecraft_2_svc }}"
env: "{{ minecraft_2_env }}"
compose: "{{ minecraft_2_compose }}"
block:
- name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,8 +1,8 @@
--- ---
svc: minecraft_2_svc:
name: minecraft-2 name: minecraft-2
svc_env: minecraft_2_env:
ALLOW_FLIGHT: true ALLOW_FLIGHT: true
ALLOW_NETHER: true ALLOW_NETHER: true
ANNOUNCE_PLAYER_ACHIEVEMENTS: true ANNOUNCE_PLAYER_ACHIEVEMENTS: true
@ -54,10 +54,9 @@ svc_env:
VIEW_DISTANCE: 10 VIEW_DISTANCE: 10
WHITELIST: "{{ vault_minecraft_2.whitelist }}" WHITELIST: "{{ vault_minecraft_2.whitelist }}"
compose: minecraft_2_compose:
watchtower: false watchtower: false
image: itzg/minecraft-server image: itzg/minecraft-server
env: true
volumes: volumes:
- data:/data - data:/data
file: file:

View file

@ -1,8 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- minio svc: "{{ minio_svc }}"
- storage env: "{{ minio_env }}"
compose: "{{ minio_compose }}"
block: block:
- name: Import tasks to deploy common service - name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: minio_svc:
domain: s3.serguzim.me domain: s3.serguzim.me
name: minio name: minio
port: 9000 port: 9000
@ -13,7 +13,7 @@ svc:
docker_host: minio docker_host: minio
port: 9001 port: 9001
svc_env: minio_env:
MINIO_SERVER_URL: https://{{ svc.domain }}/ MINIO_SERVER_URL: https://{{ svc.domain }}/
MINIO_BROWSER_REDIRECT_URL: https://console.{{ svc.domain }} MINIO_BROWSER_REDIRECT_URL: https://console.{{ svc.domain }}
MINIO_VOLUMES: /data MINIO_VOLUMES: /data
@ -21,10 +21,9 @@ svc_env:
MINIO_ROOT_USER: "{{ vault_minio.user }}" MINIO_ROOT_USER: "{{ vault_minio.user }}"
MINIO_ROOT_PASSWORD: "{{ vault_minio.pass }}" MINIO_ROOT_PASSWORD: "{{ vault_minio.pass }}"
compose: minio_compose:
watchtower: true watchtower: true
image: minio/minio image: minio/minio
env: true
volumes: volumes:
- data:/data - data:/data
file: file:

View file

@ -1,8 +1,13 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- synapse svc: "{{ synapse_svc }}"
- matrix env: "{{ synapse_env }}"
compose: "{{ synapse_compose }}"
yml: "{{ synapse_yml }}"
block: block:
- name: Import prepare tasks for common service - name: Import prepare tasks for common service
ansible.builtin.import_tasks: tasks/prepare-common-service.yml ansible.builtin.import_tasks: tasks/prepare-common-service.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: synapse_svc:
name: synapse name: synapse
domain: matrix.msrg.cc domain: matrix.msrg.cc
docker_host: synapse-admin docker_host: synapse-admin
@ -26,11 +26,11 @@ svc:
pass: "{{ vault_synapse.db.pass }}" pass: "{{ vault_synapse.db.pass }}"
config_path: config config_path: config
svc_env: synapse_env:
SYNAPSE_CONFIG_PATH: "{{ ('/', svc.config_path) | path_join }}" SYNAPSE_CONFIG_PATH: "{{ ('/', svc.config_path) | path_join }}"
REACT_APP_SERVER: https://matrix.msrg.cc REACT_APP_SERVER: https://matrix.msrg.cc
svc_yml: synapse_yml:
server_name: msrg.cc server_name: msrg.cc
pid_file: "{{ (svc.config_path, 'homeserver.pid') | path_join }}" pid_file: "{{ (svc.config_path, 'homeserver.pid') | path_join }}"
public_baseurl: https://matrix.msrg.cc/ public_baseurl: https://matrix.msrg.cc/
@ -102,10 +102,9 @@ svc_yml:
require_transport_security: true require_transport_security: true
notif_from: Matrix <matrix@serguzim.me> notif_from: Matrix <matrix@serguzim.me>
compose: synapse_compose:
watchtower: true watchtower: true
env: true image: ghcr.io/matrix-org/synapse:v1.98.0
image: ghcr.io/matrix-org/synapse
volumes: volumes:
- ./config:/config - ./config:/config
- media_store:/media_store - media_store:/media_store

View file

@ -1,8 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- tandoor svc: "{{ tandoor_svc }}"
- recipies env: "{{ tandoor_env }}"
compose: "{{ tandoor_compose }}"
block: block:
- name: Import tasks to deploy common service - name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: tandoor_svc:
domain: recipes.serguzim.me domain: recipes.serguzim.me
name: tandoor name: tandoor
port: 80 port: 80
@ -10,7 +10,7 @@ svc:
user: "{{ vault_tandoor.db.user }}" user: "{{ vault_tandoor.db.user }}"
pass: "{{ vault_tandoor.db.pass }}" pass: "{{ vault_tandoor.db.pass }}"
svc_env: tandoor_env:
DEBUG: 0 DEBUG: 0
SQL_DEBUG: 0 SQL_DEBUG: 0
@ -35,10 +35,9 @@ svc_env:
SOCIAL_DEFAULT_ACCESS: 1 SOCIAL_DEFAULT_ACCESS: 1
SOCIAL_DEFAULT_GROUP: guest SOCIAL_DEFAULT_GROUP: guest
compose: tandoor_compose:
watchtower: true watchtower: true
image: nginx:mainline-alpine image: nginx:mainline-alpine
env: true
volumes: volumes:
- nginx_config:/etc/nginx/conf.d:ro - nginx_config:/etc/nginx/conf.d:ro
- staticfiles:/static - staticfiles:/static

View file

@ -1,8 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- telegraf svc: "{{ telegraf_svc }}"
- monitoring env: "{{ telegraf_env }}"
compose: "{{ telegraf_compose }}"
block: block:
- name: Import prepare tasks for common service - name: Import prepare tasks for common service
ansible.builtin.import_tasks: tasks/prepare-common-service.yml ansible.builtin.import_tasks: tasks/prepare-common-service.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: telegraf_svc:
name: telegraf name: telegraf
influxdb: influxdb:
url: https://tick.serguzim.me url: https://tick.serguzim.me
@ -21,26 +21,9 @@ svc:
database: telegraf database: telegraf
docker_log: docker_log:
endpoint: unix:///var/run/docker.sock endpoint: unix:///var/run/docker.sock
# from_beginning: false
# timeout: "5s"
# container_name_include: []
# container_name_exclude: []
# docker_label_include: []
# docker_label_exclude: []
## Set the source tag for the metrics to the container ID hostname, eg first 12 chars
source_tag: false source_tag: false
## Optional TLS Config telegraf_compose:
# tls_ca: "/etc/telegraf/ca.pem"
# tls_cert: "/etc/telegraf/cert.pem"
# tls_key: "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify: false
compose:
watchtower: false watchtower: false
image: telegraf:1.28 image: telegraf:1.28
volumes: volumes:

View file

@ -1,9 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- tinytinyrss svc: "{{ tinytinyrss_svc }}"
- tt-rss env: "{{ tinytinyrss_env }}"
- news compose: "{{ tinytinyrss_compose }}"
block: block:
- name: Import prepare tasks for common service - name: Import prepare tasks for common service
ansible.builtin.import_tasks: tasks/prepare-common-service.yml ansible.builtin.import_tasks: tasks/prepare-common-service.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: tinytinyrss_svc:
domain: rss.serguzim.me domain: rss.serguzim.me
name: tinytinyrss name: tinytinyrss
port: 80 port: 80
@ -10,7 +10,7 @@ svc:
user: "{{ vault_tinytinyrss.db.user }}" user: "{{ vault_tinytinyrss.db.user }}"
pass: "{{ vault_tinytinyrss.db.pass }}" pass: "{{ vault_tinytinyrss.db.pass }}"
svc_env: tinytinyrss_env:
TTRSS_DB_TYPE: pgsql TTRSS_DB_TYPE: pgsql
TTRSS_DB_HOST: "{{ svc.db.host }}" TTRSS_DB_HOST: "{{ svc.db.host }}"
TTRSS_DB_NAME: "{{ svc.db.database }}" TTRSS_DB_NAME: "{{ svc.db.database }}"
@ -19,10 +19,9 @@ svc_env:
TTRSS_SELF_URL_PATH: https://{{ svc.domain }}/tt-rss/ TTRSS_SELF_URL_PATH: https://{{ svc.domain }}/tt-rss/
compose: tinytinyrss_compose:
watchtower: false watchtower: false
image: cthulhoo/ttrss-web-nginx image: cthulhoo/ttrss-web-nginx
env: true
volumes: volumes:
- app:/var/www/html:ro - app:/var/www/html:ro
- ./nginx.conf:/etc/nginx/nginx.conf - ./nginx.conf:/etc/nginx/nginx.conf

View file

@ -1,8 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- umami svc: "{{ umami_svc }}"
- analytics env: "{{ umami_env }}"
compose: "{{ umami_compose }}"
block: block:
- name: Import tasks to deploy common service - name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,21 +1,24 @@
--- ---
svc: umami_db_host: "{{ postgres.host }}"
umami_db_user: "{{ vault_umami.db.user }}"
umami_db_pass: "{{ vault_umami.db.pass }}"
umami_db_database: umami
umami_hash_salt: "{{ vault_umami.hash_salt }}"
umami_docker_image: docker.umami.dev/umami-software/umami:postgresql-latest
umami_svc:
domain: analytics.serguzim.me domain: analytics.serguzim.me
name: umami name: umami
port: 3000 port: 3000
db:
host: "{{ postgres.host }}"
user: "{{ vault_umami.db.user }}"
pass: "{{ vault_umami.db.pass }}"
db: umami
svc_env: umami_env:
DATABASE_URL: postgres://{{ svc.db.user }}:{{ svc.db.pass }}@{{ svc.db.host }}/{{ svc.db.db }} DATABASE_URL: postgres://{{ umami_db_user }}:{{ umami_db_pass }}@{{ umami_db_host }}/{{ umami_db_database }}
DATABASE_TYPE: postgresql DATABASE_TYPE: postgresql
FORCE_SSL: 1 FORCE_SSL: 1
HASH_SALT: "{{ vault_umami.hash_salt }}" HASH_SALT: "{{ umami_hash_salt }}"
compose: umami_compose:
watchtower: true watchtower: true
image: docker.umami.dev/umami-software/umami:postgresql-latest image: "{{ umami_docker_image }}"
env: true

View file

@ -1,8 +0,0 @@
---
- name: Deploy {{ svc.name }}
tags:
- uptime-kuma
- status
block:
- name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -0,0 +1,12 @@
---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }}
vars:
svc: "{{ uptime_kuma_svc }}"
env: "{{ uptime_kuma_env }}"
compose: "{{ uptime_kuma_compose }}"
block:
- name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,12 +1,12 @@
--- ---
svc: uptime_kuma_svc:
domain: status.serguzim.me domain: status.serguzim.me
additional_domains: additional_domains:
- status.serguzim.net - status.serguzim.net
name: uptime-kuma name: uptime-kuma
port: 3001 port: 3001
compose: uptime_kuma_compose:
watchtower: true watchtower: true
image: louislam/uptime-kuma:1 image: louislam/uptime-kuma:1
volumes: volumes:

View file

@ -1,8 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- watchtower svc: "{{ watchtower_svc }}"
- container env: "{{ watchtower_env }}"
compose: "{{ watchtower_compose }}"
block: block:
- name: Import tasks to deploy common service - name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,8 +1,8 @@
--- ---
svc: watchtower_svc:
name: watchtower name: watchtower
svc_env: watchtower_env:
WATCHTOWER_LABEL_ENABLE: true WATCHTOWER_LABEL_ENABLE: true
WATCHTOWER_CLEANUP: true WATCHTOWER_CLEANUP: true
WATCHTOWER_SCHEDULE: "0 27 20 * * *" WATCHTOWER_SCHEDULE: "0 27 20 * * *"
@ -16,10 +16,9 @@ svc_env:
WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD: "{{ vault_watchtower.mailer.pass }}" WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD: "{{ vault_watchtower.mailer.pass }}"
WATCHTOWER_NOTIFICATION_EMAIL_DELAY: 5 WATCHTOWER_NOTIFICATION_EMAIL_DELAY: 5
compose: watchtower_compose:
watchtower: false watchtower: false
image: containrrr/watchtower image: containrrr/watchtower
env: true
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
file: file:

View file

@ -1,7 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- webdis svc: "{{ webdis_svc }}"
env: "{{ webdis_env }}"
compose: "{{ webdis_compose }}"
block: block:
- name: Import prepare tasks for common service - name: Import prepare tasks for common service
ansible.builtin.import_tasks: tasks/prepare-common-service.yml ansible.builtin.import_tasks: tasks/prepare-common-service.yml

View file

@ -1,10 +1,10 @@
--- ---
svc: webdis_svc:
name: webdis name: webdis
domain: webdis.huck.serguzim.me domain: webdis.huck.serguzim.me
port: 7379 port: 7379
compose: webdis_compose:
watchtower: true watchtower: true
image: nicolas/webdis image: nicolas/webdis
volumes: volumes:

View file

@ -1,7 +0,0 @@
---
- name: Deploy {{ svc.name }}
tags:
- wiki-js
block:
- name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -0,0 +1,12 @@
---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }}
vars:
svc: "{{ wiki_js_svc }}"
env: "{{ wiki_js_env }}"
compose: "{{ wiki_js_compose }}"
block:
- name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: wiki_js_svc:
domain: wiki.serguzim.me domain: wiki.serguzim.me
name: wiki-js name: wiki-js
port: 3000 port: 3000
@ -10,7 +10,7 @@ svc:
pass: "{{ vault_wiki_js.db.pass }}" pass: "{{ vault_wiki_js.db.pass }}"
name: wikijs name: wikijs
svc_env: wiki_js_env:
DB_TYPE: postgres DB_TYPE: postgres
DB_HOST: "{{ svc.db.host }}" DB_HOST: "{{ svc.db.host }}"
DB_PORT: "{{ svc.db.port }}" DB_PORT: "{{ svc.db.port }}"
@ -19,7 +19,6 @@ svc_env:
DB_NAME: "{{ svc.db.name }}" DB_NAME: "{{ svc.db.name }}"
DB_SSL: 1 DB_SSL: 1
compose: wiki_js_compose:
watchtower: true watchtower: true
image: requarks/wiki image: requarks/wiki
env: true

View file

@ -1,8 +1,12 @@
--- ---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ svc.name }} - name: Deploy {{ svc.name }}
tags: vars:
- woodpecker svc: "{{ woodpecker_svc }}"
- ci env: "{{ woodpecker_env }}"
compose: "{{ woodpecker_compose }}"
block: block:
- name: Import tasks to deploy common service - name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -1,5 +1,5 @@
--- ---
svc: woodpecker_svc:
domain: ci.serguzim.me domain: ci.serguzim.me
name: woodpecker name: woodpecker
port: 8000 port: 8000
@ -14,7 +14,7 @@ svc:
user: "{{ vault_woodpecker.db.user }}" user: "{{ vault_woodpecker.db.user }}"
pass: "{{ vault_woodpecker.db.pass }}" pass: "{{ vault_woodpecker.db.pass }}"
svc_env: woodpecker_env:
WOODPECKER_OPEN: true WOODPECKER_OPEN: true
WOODPECKER_HOST: https://{{ svc.domain }} WOODPECKER_HOST: https://{{ svc.domain }}
WOODPECKER_ADMIN: serguzim WOODPECKER_ADMIN: serguzim
@ -32,10 +32,9 @@ svc_env:
WOODPECKER_DATABASE_DRIVER: postgres WOODPECKER_DATABASE_DRIVER: postgres
WOODPECKER_DATABASE_DATASOURCE: postgres://{{ svc.db.user }}:{{ svc.db.pass }}@{{ svc.db.host }}:{{ svc.db.port }}/{{ svc.db.database }}?sslmode=verify-full WOODPECKER_DATABASE_DATASOURCE: postgres://{{ svc.db.user }}:{{ svc.db.pass }}@{{ svc.db.host }}:{{ svc.db.port }}/{{ svc.db.database }}?sslmode=verify-full
compose: woodpecker_compose:
watchtower: true watchtower: true
image: woodpeckerci/woodpecker-server image: woodpeckerci/woodpecker-server
env: true
file: file:
services: services:
agent: agent:

View file

@ -4,8 +4,8 @@
- name: Import tasks to template docker compose file - name: Import tasks to template docker compose file
ansible.builtin.import_tasks: tasks/steps/template-docker-compose.yml ansible.builtin.import_tasks: tasks/steps/template-docker-compose.yml
when: not no_compose|default(False) # TODO remove when fixing "var-naming[no-role-prefix]" when: compose is defined
- name: Import tasks create a service.env file - name: Import tasks create a service.env file
ansible.builtin.import_tasks: tasks/steps/template-service-env.yml ansible.builtin.import_tasks: tasks/steps/template-service-env.yml
when: compose.env|default(False) when: env is defined

View file

@ -0,0 +1,5 @@
---
- name: Set common facts
ansible.builtin.set_fact:
service_path: "{{ (services_path, role_name | replace('_', '-')) | path_join }}"
docker_force_recreate: ""

View file

@ -1,9 +1,4 @@
--- ---
- name: Set common facts
ansible.builtin.set_fact:
service_path: "{{ (services_path, svc.name) | path_join }}"
docker_force_recreate: ""
- name: Create a service directory - name: Create a service directory
ansible.builtin.file: ansible.builtin.file:
path: "{{ service_path }}" path: "{{ service_path }}"

View file

@ -4,15 +4,9 @@
src: caddy_site.conf.j2 src: caddy_site.conf.j2
dest: "{{ (caddy_config_path, svc.domain + '.conf') | path_join }}" dest: "{{ (caddy_config_path, svc.domain + '.conf') | path_join }}"
mode: "0644" mode: "0644"
register: template_result notify:
- Reload caddy
- name: Register caddy site - name: Register caddy site
ansible.builtin.set_fact: ansible.builtin.set_fact:
managed_sites: "{{ managed_sites + [svc.domain + '.conf'] }}" managed_sites: "{{ managed_sites + [svc.domain + '.conf'] }}"
- name: Reload caddy
ansible.builtin.command:
cmd: docker compose exec app sh -c "caddy validate --config /etc/caddy/Caddyfile && caddy reload --config /etc/caddy/Caddyfile"
chdir: "{{ caddy_path }}"
when: "'local-dev' != inventory_hostname"
changed_when: template_result.changed

View file

@ -1,7 +1,7 @@
{%- set compose_file = compose.file | default({}) -%} {%- set compose_file = compose.file | default({}) -%}
{%- set compose_file = compose_file_main | combine(compose_file, recursive=True) -%} {%- set compose_file = compose_file_main | combine(compose_file, recursive=True) -%}
{%- if compose.env | default(False) -%} {%- if env is defined -%}
{%- set compose_file = compose_file | combine(compose_file_env, recursive=True) -%} {%- set compose_file = compose_file | combine(compose_file_env, recursive=True) -%}
{%- endif -%} {%- endif -%}

View file

@ -1,3 +1,3 @@
{% for key, value in svc_env.items() %} {% for key, value in env.items() %}
{{ key }}={{ value }} {{ key }}={{ value }}
{% endfor %} {% endfor %}

View file

@ -1 +1 @@
{{ svc_yml | to_nice_yaml }} {{ yml | to_nice_yaml }}