Monty Taylor ba8c84a5ca Exclude disabled group from backup-server loop
We don't set bup_user for hosts in disabled in the backup role
if they are in the disabled group, so they are not available to
be used in backup-server. We need to also exclude them here.

Change-Id: Ib5fd249533d5d8de0179bf16d61cf88f4c11f301
2020-04-11 14:53:20 -05:00

22 lines
453 B
YAML

- name: Create backup directory
file:
state: directory
path: /opt/backups
- name: Install bup
package:
name:
- bup
state: present
- name: Build all bup users from backup hosts
set_fact:
bup_users: '{{ bup_users }} + [ {{ hostvars[item]["bup_user"] }} ]'
with_inventory_hostnames: 'backup:!disabled'
- name: Create bup users
include_tasks: user.yaml
loop: '{{ bup_users }}'
loop_control:
loop_var: bup_user