ansible-borgbackup/tasks/borg-server.yml
2017-10-01 19:51:38 +02:00

32 lines
793 B
YAML

---
- name: server | install borg backup
get_url:
dest: "/usr/local/bin/borg"
checksum: "{{ borgbackup_checksum }}"
owner: "root"
group: "root"
mode: "0755"
url: "{{ borgbackup_download_url }}"
delegate_to: "{{ item.fqdn }}"
with_items: "{{ borgbackup_servers }}"
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: "{{ 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"
with_items: "{{ borgbackup_servers }}"