Files
ansible/roles/garage/tasks/main.yml
2024-07-05 11:53:31 +02:00

29 lines
748 B
YAML

---
- name: install garage
get_url:
url: "{{ garage_url }}"
dest: "{{ garage_bin }}"
owner: root
group: root
mode: 0755
force: true
notify:
- restart garage
- name: install garage systemd file
template:
src: garage.service.j2
dest: /etc/systemd/system/garage.service
- name: put garage.toml conf file
template:
src: garage.toml.j2
dest: /etc/garage.toml
vars:
cluster_group: "{{ group_names | map('regex_search', '.+_cluster') | select('string') | first }}"
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