From 2fe38a4059f799629a5bb2eb6f55a60d4038c903 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 2 Jan 2024 12:23:25 +0100 Subject: [PATCH] Implemented variable mapping to reduce complexity --- constructor.yml | 14 +++++++++++--- roles/backup-docker-to-local/tasks/main.yml | 2 +- roles/backup-remote-to-local/tasks/main.yml | 2 +- roles/cleanup-backups-timer/tasks/main.yml | 2 +- roles/cleanup-disc-space/tasks/main.yml | 2 +- roles/cleanup-failed-docker-backups/tasks/main.yml | 2 +- .../templates/docker-compose.yml.j2 | 4 ++-- .../templates/docker-compose.yml.j2 | 8 ++++---- .../templates/docker-compose.yml.j2 | 8 ++++---- roles/docker-gitea/templates/docker-compose.yml.j2 | 4 ++-- .../docker-gitlab/templates/docker-compose.yml.j2 | 6 +++--- .../docker-joomla/templates/docker-compose.yml.j2 | 6 +++--- .../templates/docker-compose.yml.j2 | 2 +- roles/docker-mailu/tasks/main.yml | 2 +- roles/docker-mailu/templates/docker-compose.yml.j2 | 8 ++++---- .../templates/docker-compose.yml.j2 | 10 +++++----- roles/docker-mastodon/templates/mastodon.conf.j2 | 2 +- .../docker-matomo/templates/docker-compose.yml.j2 | 4 ++-- .../templates/docker-compose.yml.j2 | 4 ++-- roles/docker-mybb/templates/docker-compose.yml.j2 | 6 +++--- .../templates/docker-compose.yml.j2 | 6 +++--- roles/docker-nextcloud/templates/nextcloud.conf.j2 | 2 +- .../templates/docker-compose.yml.j2 | 14 +++++++------- .../templates/docker-compose.yml.j2 | 4 ++-- roles/docker-peertube/templates/peertube.conf.j2 | 2 +- .../templates/docker-compose.yml.j2 | 6 +++--- .../templates/docker-compose.yml.j2 | 4 ++-- .../docker-yourls/templates/docker-compose.yml.j2 | 2 +- roles/heal-docker/tasks/main.yml | 2 +- roles/health-btrfs/tasks/main.yml | 2 +- roles/health-disc-space/tasks/main.yml | 2 +- roles/health-docker-container/tasks/main.yml | 2 +- roles/health-docker-volumes/tasks/main.yml | 2 +- roles/health-journalctl/tasks/main.yml | 2 +- roles/health-nginx/tasks/main.yml | 2 +- roles/health-nginx/templates/health-nginx.py.j2 | 2 +- roles/nginx-certbot/tasks/main.yml | 2 +- .../templates/domain.conf.j2 | 2 +- .../templates/homepage.nginx.conf.j2 | 2 +- roles/update-docker/tasks/main.yml | 2 +- tasks/implement-matomo-tracking.yml | 2 +- 41 files changed, 86 insertions(+), 78 deletions(-) diff --git a/constructor.yml b/constructor.yml index 45eb6c0d..16a61e2d 100644 --- a/constructor.yml +++ b/constructor.yml @@ -1,12 +1,20 @@ --- -# general setup -- name: general setup +- name: variable mapping + hosts: all + vars: + activate_all_timers: "{{ activate_all_timers | lower | bool }}" + nginx_matomo_tracking: "{{ nginx_matomo_tracking | lower | bool }}" + execute_updates: "{{ execute_updates | lower | bool }}" + force_backup_before_update: "{{ force_backup_before_update | lower | bool }}" + enable_central_database: "{{ enable_central_database | lower | bool }}" + +- name: update device hosts: all become: true tasks: roles: - role: update - when: execute_updates | bool + when: execute_updates - name: setup standard wireguard hosts: wireguard_server diff --git a/roles/backup-docker-to-local/tasks/main.yml b/roles/backup-docker-to-local/tasks/main.yml index d436835a..3b65ced3 100644 --- a/roles/backup-docker-to-local/tasks/main.yml +++ b/roles/backup-docker-to-local/tasks/main.yml @@ -37,7 +37,7 @@ - name: configure backup-docker-to-local.timer.tpl template: src=backup-docker-to-local.timer.j2 dest=/etc/systemd/system/backup-docker-to-local.timer register: backup_docker_to_local_timer - changed_when: backup_docker_to_local_timer.changed or activate_all_timers | bool + changed_when: backup_docker_to_local_timer.changed or activate_all_timers notify: restart backup-docker-to-local.timer when: run_once_backup_docker_to_local is not defined diff --git a/roles/backup-remote-to-local/tasks/main.yml b/roles/backup-remote-to-local/tasks/main.yml index 57c70220..f43489b6 100644 --- a/roles/backup-remote-to-local/tasks/main.yml +++ b/roles/backup-remote-to-local/tasks/main.yml @@ -17,7 +17,7 @@ - name: create backup-remote-to-local.timer template: src=backup-remote-to-local.timer.j2 dest=/etc/systemd/system/backup-remote-to-local.timer register: backup_backup_remote_to_local_timer - changed_when: backup_backup_remote_to_local_timer.changed or activate_all_timers | bool + changed_when: backup_backup_remote_to_local_timer.changed or activate_all_timers notify: restart backup-remote-to-local timer - name: create backups-remote-to-local.sh diff --git a/roles/cleanup-backups-timer/tasks/main.yml b/roles/cleanup-backups-timer/tasks/main.yml index f15a4fc1..5ee7f2bd 100644 --- a/roles/cleanup-backups-timer/tasks/main.yml +++ b/roles/cleanup-backups-timer/tasks/main.yml @@ -3,7 +3,7 @@ src: "cleanup-backups.timer.j2" dest: "/etc/systemd/system/cleanup-backups.timer" register: cleanup_backups_timer - changed_when: cleanup_backups_timer.changed or activate_all_timers | bool + changed_when: cleanup_backups_timer.changed or activate_all_timers notify: restart cleanup-backups.timer when: run_once_cleanup_backups_timer is not defined diff --git a/roles/cleanup-disc-space/tasks/main.yml b/roles/cleanup-disc-space/tasks/main.yml index 26a66e51..a7ceb6d2 100644 --- a/roles/cleanup-disc-space/tasks/main.yml +++ b/roles/cleanup-disc-space/tasks/main.yml @@ -20,5 +20,5 @@ src: cleanup-disc-space.timer.j2 dest: /etc/systemd/system/cleanup-disc-space.timer register: cleanup_disc_space_timer - changed_when: cleanup_disc_space_timer.changed or activate_all_timers | bool + changed_when: cleanup_disc_space_timer.changed or activate_all_timers notify: restart cleanup-disc-space.timer \ No newline at end of file diff --git a/roles/cleanup-failed-docker-backups/tasks/main.yml b/roles/cleanup-failed-docker-backups/tasks/main.yml index b36c0f18..a38df6a4 100644 --- a/roles/cleanup-failed-docker-backups/tasks/main.yml +++ b/roles/cleanup-failed-docker-backups/tasks/main.yml @@ -24,7 +24,7 @@ src: cleanup-failed-docker-backups.timer.j2 dest: /etc/systemd/system/cleanup-failed-docker-backups.timer register: cleanup_failed_docker_backups_timer - changed_when: cleanup_failed_docker_backups_timer.changed or activate_all_timers | bool + changed_when: cleanup_failed_docker_backups_timer.changed or activate_all_timers notify: restart cleanup-failed-docker-backups.timer when: run_once_cleanup_failed_docker_backups is not defined diff --git a/roles/docker-akaunting/templates/docker-compose.yml.j2 b/roles/docker-akaunting/templates/docker-compose.yml.j2 index dfe128d5..b847cfe4 100644 --- a/roles/docker-akaunting/templates/docker-compose.yml.j2 +++ b/roles/docker-akaunting/templates/docker-compose.yml.j2 @@ -14,7 +14,7 @@ services: - env/run.env environment: - AKAUNTING_SETUP -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} depends_on: - database @@ -23,6 +23,6 @@ services: volumes: data: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} \ No newline at end of file diff --git a/roles/docker-attendize/templates/docker-compose.yml.j2 b/roles/docker-attendize/templates/docker-compose.yml.j2 index 4642d39c..2c664ac6 100644 --- a/roles/docker-attendize/templates/docker-compose.yml.j2 +++ b/roles/docker-attendize/templates/docker-compose.yml.j2 @@ -9,7 +9,7 @@ services: - .:/usr/share/nginx/html - .:/var/www depends_on: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - database {% endif %} - maildev @@ -20,7 +20,7 @@ services: worker: image: attendize_worker:latest depends_on: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - database {% endif %} - maildev @@ -36,7 +36,7 @@ services: {% include 'templates/docker-redis-service.yml.j2' %} -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} depends_on: - database @@ -45,6 +45,6 @@ services: volumes: redis: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} \ No newline at end of file diff --git a/roles/docker-funkwhale/templates/docker-compose.yml.j2 b/roles/docker-funkwhale/templates/docker-compose.yml.j2 index 940becd9..1cf97f1d 100644 --- a/roles/docker-funkwhale/templates/docker-compose.yml.j2 +++ b/roles/docker-funkwhale/templates/docker-compose.yml.j2 @@ -10,7 +10,7 @@ services: restart: always image: funkwhale/api:${FUNKWHALE_VERSION:-latest} depends_on: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - postgres % endif %} - redis @@ -25,7 +25,7 @@ services: restart: always image: funkwhale/api:${FUNKWHALE_VERSION:-latest} depends_on: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - postgres % endif %} - redis @@ -62,7 +62,7 @@ services: # override those variables in your .env file if needed - "${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT}:80" -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} {% include 'templates/docker-postgres-service.yml.j2' %} {% endif %} @@ -70,6 +70,6 @@ volumes: data: redis: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} \ No newline at end of file diff --git a/roles/docker-gitea/templates/docker-compose.yml.j2 b/roles/docker-gitea/templates/docker-compose.yml.j2 index 68b0e50f..2150cab0 100644 --- a/roles/docker-gitea/templates/docker-compose.yml.j2 +++ b/roles/docker-gitea/templates/docker-compose.yml.j2 @@ -27,7 +27,7 @@ services: - data:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} depends_on: - database {% include 'templates/docker-mariadb-service.yml.j2' %} @@ -35,7 +35,7 @@ services: volumes: data: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} diff --git a/roles/docker-gitlab/templates/docker-compose.yml.j2 b/roles/docker-gitlab/templates/docker-compose.yml.j2 index e5fc014b..33a85cd9 100644 --- a/roles/docker-gitlab/templates/docker-compose.yml.j2 +++ b/roles/docker-gitlab/templates/docker-compose.yml.j2 @@ -33,7 +33,7 @@ services: - 'data:/var/opt/gitlab' shm_size: '256m' depends_on: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: condition: service_healthy {% endif %} @@ -41,7 +41,7 @@ services: {% include 'templates/docker-redis-service.yml.j2' %} -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} {% include 'templates/docker-postgres-service.yml.j2' %} {% endif %} @@ -50,6 +50,6 @@ volumes: config: logs: data: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} diff --git a/roles/docker-joomla/templates/docker-compose.yml.j2 b/roles/docker-joomla/templates/docker-compose.yml.j2 index e1749900..9a9c8594 100644 --- a/roles/docker-joomla/templates/docker-compose.yml.j2 +++ b/roles/docker-joomla/templates/docker-compose.yml.j2 @@ -11,7 +11,7 @@ services: JOOMLA_DB_PASSWORD: "{{database_password}}" JOOMLA_DB_NAME: "{{database_databasename}}" restart: always -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} depends_on: - database {% endif %} @@ -20,12 +20,12 @@ services: ports: - "127.0.0.1:{{http_port}}:80" -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} {% include 'templates/docker-mariadb-service.yml.j2' %} {% endif %} volumes: data: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} diff --git a/roles/docker-listmonk/templates/docker-compose.yml.j2 b/roles/docker-listmonk/templates/docker-compose.yml.j2 index 3a659b29..e0a99a89 100644 --- a/roles/docker-listmonk/templates/docker-compose.yml.j2 +++ b/roles/docker-listmonk/templates/docker-compose.yml.j2 @@ -12,7 +12,7 @@ services: volumes: - ./config.toml:/listmonk/config.toml -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} depends_on: - database diff --git a/roles/docker-mailu/tasks/main.yml b/roles/docker-mailu/tasks/main.yml index 4b09d8b2..a0bbec80 100644 --- a/roles/docker-mailu/tasks/main.yml +++ b/roles/docker-mailu/tasks/main.yml @@ -61,5 +61,5 @@ src: "deploy-letsencrypt-mailu.timer.j2" dest: "/etc/systemd/system/deploy-letsencrypt-mailu.timer" register: deploy_letsencrypt_mailu_timer - changed_when: deploy_letsencrypt_mailu_timer.changed or activate_all_timers | bool + changed_when: deploy_letsencrypt_mailu_timer.changed or activate_all_timers notify: restart deploy-letsencrypt-mailu.timer \ No newline at end of file diff --git a/roles/docker-mailu/templates/docker-compose.yml.j2 b/roles/docker-mailu/templates/docker-compose.yml.j2 index 74eccd20..ce4fded8 100644 --- a/roles/docker-mailu/templates/docker-compose.yml.j2 +++ b/roles/docker-mailu/templates/docker-compose.yml.j2 @@ -49,7 +49,7 @@ services: depends_on: resolver: condition: service_started -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: condition: service_healthy {% endif %} @@ -71,7 +71,7 @@ services: - resolver - front - redis -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - database {% endif %} logging: @@ -202,12 +202,12 @@ services: - webmail dns: - 192.168.203.254 -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} {% include 'templates/docker-postgres-service.yml.j2' %} {% endif %} volumes: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} smtp_queue: diff --git a/roles/docker-mastodon/templates/docker-compose.yml.j2 b/roles/docker-mastodon/templates/docker-compose.yml.j2 index 0c22ce4c..d3cf97de 100644 --- a/roles/docker-mastodon/templates/docker-compose.yml.j2 +++ b/roles/docker-mastodon/templates/docker-compose.yml.j2 @@ -20,7 +20,7 @@ services: ports: - "127.0.0.1:{{http_port}}:3000" depends_on: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - database {% endif %} - redis @@ -42,7 +42,7 @@ services: ports: - "127.0.0.1:{{stream_port}}:4000" depends_on: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - database {% endif %} - redis @@ -54,7 +54,7 @@ services: env_file: .env.production command: bundle exec sidekiq depends_on: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - database {% endif %} - redis @@ -67,12 +67,12 @@ services: test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"] logging: driver: journald -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} {% include 'templates/docker-postgres-service.yml.j2' %} {% endif %} volumes: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} redis: diff --git a/roles/docker-mastodon/templates/mastodon.conf.j2 b/roles/docker-mastodon/templates/mastodon.conf.j2 index e983d022..f20fc840 100644 --- a/roles/docker-mastodon/templates/mastodon.conf.j2 +++ b/roles/docker-mastodon/templates/mastodon.conf.j2 @@ -8,7 +8,7 @@ server { {% include 'roles/letsencrypt/templates/ssl_header.j2' %} - {% if nginx_matomo_tracking | bool %} + {% if nginx_matomo_tracking %} {% include 'roles/nginx-matomo-tracking/templates/matomo-tracking.conf.j2' %} {% endif %} diff --git a/roles/docker-matomo/templates/docker-compose.yml.j2 b/roles/docker-matomo/templates/docker-compose.yml.j2 index 022c018d..c9749067 100644 --- a/roles/docker-matomo/templates/docker-compose.yml.j2 +++ b/roles/docker-matomo/templates/docker-compose.yml.j2 @@ -16,14 +16,14 @@ services: MATOMO_DATABASE_DBNAME: "{{database_databasename}}" volumes: - data:/var/www/html -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} depends_on: - database {% include 'templates/docker-mariadb-service.yml.j2' %} {% endif %} volumes: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} data: diff --git a/roles/docker-matrix-compose/templates/docker-compose.yml.j2 b/roles/docker-matrix-compose/templates/docker-compose.yml.j2 index 02605f95..27f12f8a 100644 --- a/roles/docker-matrix-compose/templates/docker-compose.yml.j2 +++ b/roles/docker-matrix-compose/templates/docker-compose.yml.j2 @@ -16,7 +16,7 @@ services: - SYNAPSE_REPORT_STATS=no ports: - "127.0.0.1:{{synapse_http_port}}:8008" -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} depends_on: - database {% include 'templates/docker-postgres-service.yml.j2' %} @@ -60,7 +60,7 @@ services: # - instagram_bridge_data:/data volumes: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} synapse_data: diff --git a/roles/docker-mybb/templates/docker-compose.yml.j2 b/roles/docker-mybb/templates/docker-compose.yml.j2 index 806a9018..6a300ebf 100644 --- a/roles/docker-mybb/templates/docker-compose.yml.j2 +++ b/roles/docker-mybb/templates/docker-compose.yml.j2 @@ -9,7 +9,7 @@ services: restart: always volumes: - data:/var/www/html -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} depends_on: - database {% endif %} @@ -26,12 +26,12 @@ services: - "{{docker_compose_instance_confd_directory}}:{{target_mount_conf_d_directory}}:ro" - "data:/var/www/html:ro" -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} {% include 'templates/docker-mariadb-service.yml.j2' %} {% endif %} volumes: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} data: diff --git a/roles/docker-nextcloud/templates/docker-compose.yml.j2 b/roles/docker-nextcloud/templates/docker-compose.yml.j2 index 6c326e23..112c762c 100644 --- a/roles/docker-nextcloud/templates/docker-compose.yml.j2 +++ b/roles/docker-nextcloud/templates/docker-compose.yml.j2 @@ -13,7 +13,7 @@ services: MYSQL_USER: "{{database_username}}" MYSQL_PASSWORD: "{{database_password}}" MYSQL_HOST: {{database_host}}:3306 -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} depends_on: - database @@ -45,12 +45,12 @@ services: - data:/var/www/html entrypoint: /cron.sh depends_on: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - database {% endif %} - redis volumes: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} data: diff --git a/roles/docker-nextcloud/templates/nextcloud.conf.j2 b/roles/docker-nextcloud/templates/nextcloud.conf.j2 index 007fcfe7..6945a385 100644 --- a/roles/docker-nextcloud/templates/nextcloud.conf.j2 +++ b/roles/docker-nextcloud/templates/nextcloud.conf.j2 @@ -4,7 +4,7 @@ server {% include 'roles/letsencrypt/templates/ssl_header.j2' %} - {% if nginx_matomo_tracking | bool %} + {% if nginx_matomo_tracking %} {% include 'roles/nginx-matomo-tracking/templates/matomo-tracking.conf.j2' %} {% endif %} diff --git a/roles/docker-openproject/templates/docker-compose.yml.j2 b/roles/docker-openproject/templates/docker-compose.yml.j2 index 611a520b..0b38061e 100644 --- a/roles/docker-openproject/templates/docker-compose.yml.j2 +++ b/roles/docker-openproject/templates/docker-compose.yml.j2 @@ -5,7 +5,7 @@ networks: backend: volumes: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} data: @@ -30,13 +30,13 @@ x-op-app: &app IMAP_ENABLED: "${IMAP_ENABLED:-false}" volumes: - "data:/var/openproject/assets" -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - "database:/var/openproject/pgdata" {% endif %} services: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} {% include 'templates/docker-postgres-service.yml.j2' %} {% endif %} networks: @@ -62,7 +62,7 @@ services: - frontend volumes: - "data:/var/openproject/assets" -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - "database:/var/openproject/pgdata" {% endif %} @@ -73,7 +73,7 @@ services: - frontend - backend depends_on: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - database {% endif %} - cache @@ -102,7 +102,7 @@ services: networks: - backend depends_on: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - database {% endif %} - cache @@ -114,7 +114,7 @@ services: networks: - backend depends_on: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - database {% endif %} - cache diff --git a/roles/docker-peertube/templates/docker-compose.yml.j2 b/roles/docker-peertube/templates/docker-compose.yml.j2 index 9f0fc721..35a22df7 100644 --- a/roles/docker-peertube/templates/docker-compose.yml.j2 +++ b/roles/docker-peertube/templates/docker-compose.yml.j2 @@ -15,7 +15,7 @@ services: restart: "always" depends_on: - redis -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - database {% include 'templates/docker-postgres-service.yml.j2' %} @@ -27,7 +27,7 @@ services: - .env volumes: assets: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} data: diff --git a/roles/docker-peertube/templates/peertube.conf.j2 b/roles/docker-peertube/templates/peertube.conf.j2 index ece8161e..ec84d8bc 100644 --- a/roles/docker-peertube/templates/peertube.conf.j2 +++ b/roles/docker-peertube/templates/peertube.conf.j2 @@ -3,7 +3,7 @@ server { {% include 'roles/letsencrypt/templates/ssl_header.j2' %} - {% if nginx_matomo_tracking | bool %} + {% if nginx_matomo_tracking %} {% include 'roles/nginx-matomo-tracking/templates/matomo-tracking.conf.j2' %} {% endif %} diff --git a/roles/docker-pixelfed/templates/docker-compose.yml.j2 b/roles/docker-pixelfed/templates/docker-compose.yml.j2 index 1f8d0780..a8f471fa 100644 --- a/roles/docker-pixelfed/templates/docker-compose.yml.j2 +++ b/roles/docker-pixelfed/templates/docker-compose.yml.j2 @@ -15,7 +15,7 @@ services: ports: - "{{http_port}}:80" depends_on: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - database {% endif %} - redis @@ -39,7 +39,7 @@ services: depends_on: - redis - application -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} - database @@ -49,7 +49,7 @@ services: {% include 'templates/docker-redis-service.yml.j2' %} volumes: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} redis: diff --git a/roles/docker-wordpress/templates/docker-compose.yml.j2 b/roles/docker-wordpress/templates/docker-compose.yml.j2 index 14ded290..73f80ea4 100644 --- a/roles/docker-wordpress/templates/docker-compose.yml.j2 +++ b/roles/docker-wordpress/templates/docker-compose.yml.j2 @@ -17,7 +17,7 @@ services: WORDPRESS_DB_NAME: "{{database_databasename}}" volumes: - data:/var/www/html -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} depends_on: - database @@ -25,7 +25,7 @@ services: {% endif %} volumes: -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} database: {% endif %} data: diff --git a/roles/docker-yourls/templates/docker-compose.yml.j2 b/roles/docker-yourls/templates/docker-compose.yml.j2 index b28dcdab..9c271134 100644 --- a/roles/docker-yourls/templates/docker-compose.yml.j2 +++ b/roles/docker-yourls/templates/docker-compose.yml.j2 @@ -16,7 +16,7 @@ services: YOURLS_SITE: "https://{{domain}}" YOURLS_USER: "{{yourls_user}}" YOURLS_PASS: "{{yourls_user_password}}" -{% if not ( enable_central_database | lower | bool ) %} +{% if not enable_central_database %} depends_on: - database diff --git a/roles/heal-docker/tasks/main.yml b/roles/heal-docker/tasks/main.yml index 8c4c2c44..e306af78 100644 --- a/roles/heal-docker/tasks/main.yml +++ b/roles/heal-docker/tasks/main.yml @@ -23,7 +23,7 @@ src: heal-docker.timer.j2 dest: "/etc/systemd/system/heal-docker.timer" register: heal_docker_timer - changed_when: heal_docker_timer.changed or activate_all_timers | bool + changed_when: heal_docker_timer.changed or activate_all_timers notify: restart heal-docker.timer when: run_once_heal_docker is not defined diff --git a/roles/health-btrfs/tasks/main.yml b/roles/health-btrfs/tasks/main.yml index cc7d27fc..aa05a697 100644 --- a/roles/health-btrfs/tasks/main.yml +++ b/roles/health-btrfs/tasks/main.yml @@ -20,5 +20,5 @@ src: health-btrfs.timer.j2 dest: "/etc/systemd/system/health-btrfs.timer" register: health_btrs_timer - changed_when: health_btrs_timer.changed or activate_all_timers | bool + changed_when: health_btrs_timer.changed or activate_all_timers notify: restart health-btrfs.timer diff --git a/roles/health-disc-space/tasks/main.yml b/roles/health-disc-space/tasks/main.yml index e17c0d6f..eca7f270 100644 --- a/roles/health-disc-space/tasks/main.yml +++ b/roles/health-disc-space/tasks/main.yml @@ -20,5 +20,5 @@ src: health-disc-space.timer.j2 dest: /etc/systemd/system/health-disc-space.timer register: health_disc_space_timer - changed_when: health_disc_space_timer.changed or activate_all_timers | bool + changed_when: health_disc_space_timer.changed or activate_all_timers notify: restart health-disc-space.timer diff --git a/roles/health-docker-container/tasks/main.yml b/roles/health-docker-container/tasks/main.yml index 8fc8182a..89e3953d 100644 --- a/roles/health-docker-container/tasks/main.yml +++ b/roles/health-docker-container/tasks/main.yml @@ -21,7 +21,7 @@ src: health-docker-container.timer.j2 dest: "/etc/systemd/system/health-docker-container.timer" register: health_docker_container_timer - changed_when: health_docker_container_timer.changed or activate_all_timers | bool + changed_when: health_docker_container_timer.changed or activate_all_timers notify: restart health-docker-container.timer when: run_once_health_docker_container is not defined diff --git a/roles/health-docker-volumes/tasks/main.yml b/roles/health-docker-volumes/tasks/main.yml index dfd6838c..138fa41d 100644 --- a/roles/health-docker-volumes/tasks/main.yml +++ b/roles/health-docker-volumes/tasks/main.yml @@ -21,7 +21,7 @@ src: health-docker-volumes.timer.j2 dest: "/etc/systemd/system/health-docker-volumes.timer" register: health_docker_volumes_timer - changed_when: health_docker_volumes_timer.changed or activate_all_timers | bool + changed_when: health_docker_volumes_timer.changed or activate_all_timers notify: restart health-docker-volumes.timer when: run_once_health_docker_volumes is not defined diff --git a/roles/health-journalctl/tasks/main.yml b/roles/health-journalctl/tasks/main.yml index 78aaeb7b..9c937b58 100644 --- a/roles/health-journalctl/tasks/main.yml +++ b/roles/health-journalctl/tasks/main.yml @@ -20,5 +20,5 @@ src: health-journalctl.timer.j2 dest: /etc/systemd/system/health-journalctl.timer register: health_journalctl_timer - changed_when: health_journalctl_timer.changed or activate_all_timers | bool + changed_when: health_journalctl_timer.changed or activate_all_timers notify: restart health-journalctl.timer diff --git a/roles/health-nginx/tasks/main.yml b/roles/health-nginx/tasks/main.yml index 7810ef3d..11757eed 100644 --- a/roles/health-nginx/tasks/main.yml +++ b/roles/health-nginx/tasks/main.yml @@ -29,7 +29,7 @@ src: health-nginx.timer.j2 dest: "/etc/systemd/system/health-nginx.timer" register: health_nginx_timer - changed_when: health_nginx_timer.changed or activate_all_timers | bool + changed_when: health_nginx_timer.changed or activate_all_timers notify: restart health-nginx.timer when: run_once_health_nginx is not defined diff --git a/roles/health-nginx/templates/health-nginx.py.j2 b/roles/health-nginx/templates/health-nginx.py.j2 index c7f51eaf..91945a8f 100644 --- a/roles/health-nginx/templates/health-nginx.py.j2 +++ b/roles/health-nginx/templates/health-nginx.py.j2 @@ -31,7 +31,7 @@ for filename in os.listdir(config_path): # Determine expected status codes based on the domain if domain == '{{domain_listmonk}}': expected_statuses = [401] -{% if nginx_matomo_tracking | bool %} +{% if nginx_matomo_tracking %} elif parts[0] == 'www' or domain in redirected_domains: expected_statuses = [301] {% endif %} diff --git a/roles/nginx-certbot/tasks/main.yml b/roles/nginx-certbot/tasks/main.yml index 29b5e0b9..767698b6 100644 --- a/roles/nginx-certbot/tasks/main.yml +++ b/roles/nginx-certbot/tasks/main.yml @@ -16,7 +16,7 @@ src: certbot.timer.j2 dest: /etc/systemd/system/certbot.timer register: certbot_timer - changed_when: certbot_timer.changed or activate_all_timers | bool + changed_when: certbot_timer.changed or activate_all_timers notify: restart certbot timer when: run_once_nginx_certbot is not defined diff --git a/roles/nginx-docker-reverse-proxy/templates/domain.conf.j2 b/roles/nginx-docker-reverse-proxy/templates/domain.conf.j2 index e5dde64e..051c683e 100644 --- a/roles/nginx-docker-reverse-proxy/templates/domain.conf.j2 +++ b/roles/nginx-docker-reverse-proxy/templates/domain.conf.j2 @@ -3,7 +3,7 @@ server server_name {{domain}}; # Include Matomo Tracking Code - {% if nginx_matomo_tracking | bool %} + {% if nginx_matomo_tracking %} {% include 'roles/nginx-matomo-tracking/templates/matomo-tracking.conf.j2' %} {% endif %} diff --git a/roles/nginx-homepage/templates/homepage.nginx.conf.j2 b/roles/nginx-homepage/templates/homepage.nginx.conf.j2 index 19406858..4c03694e 100644 --- a/roles/nginx-homepage/templates/homepage.nginx.conf.j2 +++ b/roles/nginx-homepage/templates/homepage.nginx.conf.j2 @@ -5,7 +5,7 @@ server {% include 'roles/letsencrypt/templates/ssl_header.j2' %} - {% if nginx_matomo_tracking | bool %} + {% if nginx_matomo_tracking %} {% include 'roles/nginx-matomo-tracking/templates/matomo-tracking.conf.j2' %} {% endif %} diff --git a/roles/update-docker/tasks/main.yml b/roles/update-docker/tasks/main.yml index c0576bf5..4b5bc5ef 100644 --- a/roles/update-docker/tasks/main.yml +++ b/roles/update-docker/tasks/main.yml @@ -2,7 +2,7 @@ systemd: name: backup-docker-to-local-everything.service state: started - when: force_backup_before_update | bool + when: force_backup_before_update - name: create {{update_docker_script}} copy: diff --git a/tasks/implement-matomo-tracking.yml b/tasks/implement-matomo-tracking.yml index bbebfd24..fe4636ac 100644 --- a/tasks/implement-matomo-tracking.yml +++ b/tasks/implement-matomo-tracking.yml @@ -1,4 +1,4 @@ - name: Activate NGINX matomo tracking include_role: name: nginx-matomo-tracking - when: nginx_matomo_tracking | bool and domain is defined \ No newline at end of file + when: nginx_matomo_tracking and domain is defined \ No newline at end of file