first version

This commit is contained in:
cpu
2024-01-31 14:28:36 +01:00
parent ffa90bce8b
commit 3f15c9e579
11 changed files with 358 additions and 1 deletions

38
tasks/validate_config.yml Normal file
View File

@@ -0,0 +1,38 @@
---
- name: Fail if required Immich settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`) for using this role.
when: "vars[item] | string == ''"
with_items:
- immich_identifier
- immich_uid
- immich_gid
- immich_container_network
- immich_hostname
- immich_path_prefix
- immich_config_database_hostname
- immich_config_database_username
- immich_config_database_password
- immich_config_redis_hostname
- when: immich_container_labels_traefik_enabled | bool
block:
- name: Fail if required Immich Traefik settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
with_items:
- immich_container_labels_traefik_hostname
- immich_container_labels_traefik_path_prefix
# We ensure it doesn't end with a slash, because we handle both (slash and no-slash).
# Knowing that `immich_container_labels_traefik_path_prefix` does not end with a slash
# ensures we know how to set these routes up without having to do "does it end with a slash" checks elsewhere.
- name: Fail if immich_container_labels_traefik_path_prefix ends with a slash
ansible.builtin.fail:
msg: >-
immich_container_labels_traefik_path_prefix (`{{ immich_container_labels_traefik_path_prefix }}`) must either be `/` or not end with a slash (e.g. `/immich`).
when: "immich_container_labels_traefik_path_prefix != '/' and immich_container_labels_traefik_path_prefix[-1] == '/'"