ansible-borgbackup/tasks/borg-server.yml

32 lines
793 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"
2017-10-01 11:05:59 +00:00
checksum: "{{ borgbackup_checksum }}"
2017-09-07 18:35:01 +00:00
owner: "root"
group: "root"
mode: "0755"
2017-10-01 11:05:59 +00:00
url: "{{ borgbackup_download_url }}"
2017-09-07 18:35:01 +00:00
delegate_to: "{{ item.fqdn }}"
2017-10-01 17:51:38 +00:00
with_items: "{{ borgbackup_servers }}"
2017-09-07 18:35:01 +00:00
when: item.type == 'normal'
- name: server | create user
user:
name: "{{ item.user }}"
shell: "/bin/bash"
home: "{{ item.home }}"
createhome: "yes"
delegate_to: "{{ item.fqdn }}"
2017-10-01 17:51:38 +00:00
with_items: "{{ borgbackup_servers }}"
2017-09-07 18:35:01 +00:00
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-10-01 17:51:38 +00:00
with_items: "{{ borgbackup_servers }}"