- 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 - name: Create bup users include_tasks: user.yaml loop: '{{ bup_users }}' loop_control: loop_var: bup_user