ansible-borgbackup/tasks/borg-server.yml
Luc Stroobant 9aec525cb1 add items
2017-09-12 20:50:57 +02:00

32 lines
766 B
YAML

---
- name: server | install borg backup
get_url:
dest: "/usr/local/bin/borg"
checksum: "{{ borg_checksum }}"
owner: "root"
group: "root"
mode: "0755"
url: "{{ borg_download_url }}"
delegate_to: "{{ item.fqdn }}"
with_items: "{{ backupservers }}"
when: item.type == 'normal'
- name: server | create user
user:
name: "{{ item.user }}"
shell: "/bin/bash"
home: "{{ item.home }}"
createhome: "yes"
delegate_to: "{{ item.fqdn }}"
with_items: "{{ backupservers }}"
when: item.type == 'normal'
- name: server | create directories
file:
path: "{{ item.home}}{{ item.pool }}"
state: "directory"
owner: "{{ item.user }}"
group: "{{ item.user }}"
mode: "0770"
with_items: "{{ backupservers }}"