From 5d8f45dfdcf2f448f99f6847c151a28a827ca484 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 16 Mar 2023 14:41:37 +0200 Subject: [PATCH] Make service prefix configurable --- group_vars/mash_servers | 14 +++++++------- roles/mash/playbook_base/defaults/main.yml | 14 +++++++++++--- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/group_vars/mash_servers b/group_vars/mash_servers index bce03aa..ad0410b 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -39,7 +39,7 @@ devture_systemd_service_manager_services_list_auto: | devture_postgres_enabled: false -devture_postgres_identifier: mash-postgres +devture_postgres_identifier: "{{ mash_playbook_service_identifier_prefix }}postgres" devture_postgres_architecture: "{{ mash_playbook_architecture }}" @@ -107,7 +107,7 @@ devture_playbook_state_preserver_commit_hash_preservation_dst: "{{ mash_playbook devture_container_socket_proxy_enabled: "{{ devture_traefik_enabled }}" -devture_container_socket_proxy_identifier: mash-container-socket-proxy +devture_container_socket_proxy_identifier: "{{ mash_playbook_service_identifier_prefix }}container-socket-proxy" devture_container_socket_proxy_base_path: "{{ mash_playbook_base_path }}/container-socket-proxy" @@ -133,7 +133,7 @@ devture_container_socket_proxy_api_containers_enabled: true devture_traefik_enabled: "{{ mash_playbook_reverse_proxy_type == 'playbook-managed-traefik' }}" -devture_traefik_identifier: mash-traefik +devture_traefik_identifier: "{{ mash_playbook_service_identifier_prefix }}traefik" devture_traefik_base_path: "{{ mash_playbook_base_path }}/traefik" @@ -206,7 +206,7 @@ devture_timesync_installation_enabled: false miniflux_enabled: false -miniflux_identifier: mash-miniflux +miniflux_identifier: "{{ mash_playbook_service_identifier_prefix }}miniflux" miniflux_base_path: "{{ mash_playbook_base_path }}/miniflux" @@ -244,7 +244,7 @@ miniflux_database_password: "{{ '%s' | format(mash_playbook_generic_secret_key) radicale_enabled: false -radicale_identifier: mash-radicale +radicale_identifier: "{{ mash_playbook_service_identifier_prefix }}radicale" radicale_base_path: "{{ mash_playbook_base_path }}/radicale" @@ -277,7 +277,7 @@ radicale_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certReso vaultwarden_enable: false -vaultwarden_identifier: mash-vaultwarden +vaultwarden_identifier: "{{ mash_playbook_service_identifier_prefix }}vaultwarden" vaultwarden_uid: "{{ mash_playbook_uid }}" vaultwarden_gid: "{{ mash_playbook_gid }}" @@ -322,7 +322,7 @@ vaultwarden_database_password: "{{ '%s' | format(mash_playbook_generic_secret_ke uptime_kuma_enabled: false -uptime_kuma_identifier: mash-uptime-kuma +uptime_kuma_identifier: "{{ mash_playbook_service_identifier_prefix }}uptime-kuma" uptime_kuma_base_path: "{{ mash_playbook_base_path }}/uptime-kuma" diff --git a/roles/mash/playbook_base/defaults/main.yml b/roles/mash/playbook_base/defaults/main.yml index 67a5b39..2367e7d 100644 --- a/roles/mash/playbook_base/defaults/main.yml +++ b/roles/mash/playbook_base/defaults/main.yml @@ -1,7 +1,11 @@ --- -mash_playbook_user_username: mash -mash_playbook_user_groupname: mash +# Controls the identifier for this MASH stack. +# This affects user/groups, systemd service names, container names, container networks, base installation path, etc. +mash_playbook_identifier: mash + +mash_playbook_user_username: "{{ mash_playbook_identifier }}" +mash_playbook_user_groupname: "{{ mash_playbook_identifier }}" # By default, the playbook creates the user (`mash_playbook_user_username`) # and group (`mash_playbook_user_groupname`) with a random id. @@ -13,8 +17,12 @@ mash_playbook_gid: ~ # You can put any string here, but generating a strong one is preferred (e.g. `pwgen -s 64 1`). mash_playbook_generic_secret_key: '' +# Controls the prefixed used for all service identifiers. +# This affects systemd service names, container names, container networks, etc. +mash_playbook_service_identifier_prefix: "{{ mash_playbook_identifier }}-" + # Controls the base path where all services will be installed -mash_playbook_base_path: /mash +mash_playbook_base_path: "/{{ mash_playbook_identifier }}" mash_playbook_base_path_mode: "750" # The architecture that your server runs.