ansible-borgbackup/tasks/main.yml

25 lines
789 B
YAML
Raw Normal View History

2017-09-07 18:35:01 +00:00
---
# Due to inverse logic behaviour when searching for an item in an undefined list.
2018-08-30 21:37:26 +00:00
- name: setting facts
set_fact:
borgbackup_servers_group: "{{ groups.borgbackup_servers | default([]) }} "
borgbackup_management_group: "{{ groups.borgbackup_management | default([]) }}"
2018-02-04 19:00:49 +00:00
- include_tasks: install.yml
2017-09-12 18:49:20 +00:00
when: >
2017-10-01 11:05:59 +00:00
borgbackup_required == True or
inventory_hostname in borgbackup_servers_group
2017-09-07 18:35:01 +00:00
2018-02-04 19:00:49 +00:00
- include_tasks: borg-server.yml
when: inventory_hostname in borgbackup_servers_group
2017-09-07 18:35:01 +00:00
2018-02-04 19:00:49 +00:00
- include_tasks: borg-client.yml
2017-09-12 18:49:20 +00:00
when: >
2017-10-01 11:05:59 +00:00
borgbackup_required == True and
inventory_hostname not in borgbackup_servers_group
2017-10-01 17:24:50 +00:00
2018-02-04 19:00:49 +00:00
- include_tasks: management.yml
2017-10-01 17:24:50 +00:00
when: >
inventory_hostname in borgbackup_management_group and
inventory_hostname not in borgbackup_servers_group