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

31 lines
835 B
YAML

---
- name: Install garage
ansible.builtin.get_url:
url: "{{ garage_url }}"
dest: "{{ garage_bin }}"
owner: root
group: root
mode: "0o755"
force: true
notify:
- Restart garage
- name: Install garage systemd file
ansible.builtin.template:
src: garage.service.j2
dest: /etc/systemd/system/garage.service
mode: "0o644"
- name: Put garage.toml conf file
ansible.builtin.template:
src: garage.toml.j2
dest: /etc/garage.toml
mode: "0o644"
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