diff --git a/group_vars/garage_prd_cluster.yml b/group_vars/garage_prd_cluster.yml index 926b6e3..32dcb98 100644 --- a/group_vars/garage_prd_cluster.yml +++ b/group_vars/garage_prd_cluster.yml @@ -10,3 +10,5 @@ garage_rpc_secret: !vault | 39663439303466613337376162646131373863666632626638653837386432633339326235376634 34303565306134316464363931633933336139323933613133346665313836356634663139353061 66386436626362316531 + +garage_root_domain: ".garage.mateu.be" diff --git a/roles/garage/tasks/main.yml b/roles/garage/tasks/main.yml index 90a2207..5256b2a 100644 --- a/roles/garage/tasks/main.yml +++ b/roles/garage/tasks/main.yml @@ -22,6 +22,7 @@ dest: /etc/garage.toml vars: cluster_group: "{{ group_names | map('regex_search', '.+_cluster') | select('string') | first }}" - garage_replication_mode: "{{ groups[cluster_group] | length if (groups[cluster_group]|length) <=3 else 3 }}" + cluster_group_length: "{{ groups[cluster_group] | reject('search', 'gw') | length }}" + garage_replication_mode: "{{ cluster_group_length | int if (cluster_group_length | int) <= 3 else 3 }}" notify: - restart garage diff --git a/roles/garage/templates/garage.toml.j2 b/roles/garage/templates/garage.toml.j2 index 503e2d4..850461d 100644 --- a/roles/garage/templates/garage.toml.j2 +++ b/roles/garage/templates/garage.toml.j2 @@ -13,8 +13,8 @@ rpc_secret = "{{ garage_rpc_secret }}" [s3_api] s3_region = "garage" api_bind_addr = "[::]:3900" -root_domain = ".garage.mateu.be" +root_domain = "{{ garage_root_domain }}" [s3_web] bind_addr = "[::1]:3902" -root_domain = ".garage.mateu.be" +root_domain = "{{ garage_root_domain }}"