31 lines
767 B
YAML
31 lines
767 B
YAML
---
|
|
- name: server | create user
|
|
user:
|
|
name: "{{ item.user }}"
|
|
shell: "/bin/bash"
|
|
home: "{{ item.home }}"
|
|
createhome: "yes"
|
|
delegate_to: "{{ item.fqdn }}"
|
|
with_items: "{{ borgbackup_servers }}"
|
|
when: item.type == 'normal'
|
|
|
|
- name: server | set permissions
|
|
file:
|
|
dest: "{{ item.home }}"
|
|
owner: "{{ item.user }}"
|
|
group: "{{ item.user }}"
|
|
delegate_to: "{{ item.fqdn }}"
|
|
with_items: "{{ borgbackup_servers }}"
|
|
when: item.type == 'normal'
|
|
|
|
- name: server | create directories
|
|
file:
|
|
path: "{{ item.home}}{{ item.pool }}"
|
|
state: "directory"
|
|
owner: "{{ item.user }}"
|
|
group: "{{ item.user }}"
|
|
mode: "0770"
|
|
delegate_to: "{{ item.fqdn }}"
|
|
with_items: "{{ borgbackup_servers }}"
|
|
when: item.type == 'normal'
|