mirror of
https://github.com/borgbase/ansible-role-borgbackup.git
synced 2024-11-19 19:07:42 +01:00
26 lines
758 B
YAML
26 lines
758 B
YAML
|
---
|
||
|
# So in different positions in that role we need the user home
|
||
|
# Since we cannot be sure that this FSH is compatible we will determine it.
|
||
|
- name: Get home dir
|
||
|
when:
|
||
|
- borg_user == "root"
|
||
|
block:
|
||
|
- name: Get home if borg_user == "root"
|
||
|
ansible.builtin.user:
|
||
|
name: "{{ borg_user }}"
|
||
|
state: present
|
||
|
register: user_info
|
||
|
changed_when: false
|
||
|
check_mode: true # Important, otherwise user will be created
|
||
|
|
||
|
- name: Save the user_info, we need them for the home_dir
|
||
|
ansible.builtin.set_fact:
|
||
|
backup_user_info: "{{ user_info }}"
|
||
|
|
||
|
- name: Create user if borg_user != "root"
|
||
|
when:
|
||
|
- borg_user != "root"
|
||
|
ansible.builtin.include_tasks:
|
||
|
file: noauto_create_backup_user_and_group.yml
|
||
|
...
|