Allow undefined borgbackup_servers and borgbackup_management groups.
This commit is contained in:
parent
0d50034758
commit
548dfd9aee
@ -1,18 +1,23 @@
|
|||||||
---
|
---
|
||||||
|
# Due to inverse logic behaviour when searching for an item in an undefined list.
|
||||||
|
- set_fact:
|
||||||
|
borgbackup_servers_group: "{{ groups.borgbackup_servers | default([]) }} "
|
||||||
|
borgbackup_management_group: "{{ groups.borgbackup_management | default([]) }}"
|
||||||
|
|
||||||
- include_tasks: install.yml
|
- include_tasks: install.yml
|
||||||
when: >
|
when: >
|
||||||
borgbackup_required == True or
|
borgbackup_required == True or
|
||||||
inventory_hostname in groups.borgbackup_servers
|
inventory_hostname in borgbackup_servers_group
|
||||||
|
|
||||||
- include_tasks: borg-server.yml
|
- include_tasks: borg-server.yml
|
||||||
when: inventory_hostname in groups.borgbackup_servers
|
when: inventory_hostname in borgbackup_servers_group
|
||||||
|
|
||||||
- include_tasks: borg-client.yml
|
- include_tasks: borg-client.yml
|
||||||
when: >
|
when: >
|
||||||
borgbackup_required == True and
|
borgbackup_required == True and
|
||||||
inventory_hostname not in groups.borgbackup_servers
|
inventory_hostname not in borgbackup_servers_group
|
||||||
|
|
||||||
- include_tasks: management.yml
|
- include_tasks: management.yml
|
||||||
when: >
|
when: >
|
||||||
inventory_hostname in groups.borgbackup_management and
|
inventory_hostname in borgbackup_management_group and
|
||||||
inventory_hostname not in groups.borgbackup_servers
|
inventory_hostname not in borgbackup_servers_group
|
||||||
|
Loading…
Reference in New Issue
Block a user