hlab/ansible/playbooks/borg_server.yaml

30 lines
807 B
YAML

---
- name: Evaluate borg client nodes
hosts: all
gather_facts: false
tasks:
- name: Gather configured clients
ansible.builtin.group_by:
key: "borg_clients_{{ configure_borg_client | default('False') }}"
# Creates: borg_clients_True and borg_clients_False
- name: Configure borg backups system
hosts: borg_clients_True:borg
debugger: on_failed
tasks:
- name: Configure clients
include_role:
name: borg
apply:
become: true
become_exe: "{{ become_exe_value }}"
when: "{{ configure_borg_client | default(false) }} "
- name: Configure server
include_role:
name: borg
apply:
become: true
become_exe: "{{ become_exe_value }}"
when: "{{ configure_borg_server | default(false) }} "