ansible-borgbackup/tasks/borg-server.yml

32 lines
766 B
YAML
Raw Normal View History

2017-09-07 18:35:01 +00:00
---
- 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:
2017-09-12 18:50:57 +00:00
path: "{{ item.home}}{{ item.pool }}"
2017-09-07 18:35:01 +00:00
state: "directory"
owner: "{{ item.user }}"
group: "{{ item.user }}"
mode: "0770"
2017-09-12 18:50:57 +00:00
with_items: "{{ backupservers }}"