aboutsummaryrefslogtreecommitdiff
path: root/tasks/server.yml
diff options
context:
space:
mode:
authorJulien Dessaux2019-07-09 11:45:03 +0200
committerJulien Dessaux2019-07-09 13:23:47 +0200
commit5b953c8dba0d7d4be10f93dfa10da975e5be1294 (patch)
tree2614f898ee114b77a1f7d3ef2af28e1724902747 /tasks/server.yml
downloadborg-ansible-role-5b953c8dba0d7d4be10f93dfa10da975e5be1294.tar.gz
borg-ansible-role-5b953c8dba0d7d4be10f93dfa10da975e5be1294.tar.bz2
borg-ansible-role-5b953c8dba0d7d4be10f93dfa10da975e5be1294.zip
Added borg backup role
Diffstat (limited to 'tasks/server.yml')
-rw-r--r--tasks/server.yml26
1 files changed, 26 insertions, 0 deletions
diff --git a/tasks/server.yml b/tasks/server.yml
new file mode 100644
index 0000000..bd40dab
--- /dev/null
+++ b/tasks/server.yml
@@ -0,0 +1,26 @@
+---
+- name: Create borg group on server
+ group:
+ name: borg
+ system: yes
+
+- name: Create borg user on server
+ user:
+ name: borg
+ shell: /bin/sh
+ home: /srv/borg
+ createhome: yes
+ system: yes
+ password_lock: yes
+
+- name: Ensure borg directories exist on server
+ file:
+ state: directory
+ path: "{{ item }}"
+ owner: borg
+ mode: 0700
+ loop:
+ - /srv/borg
+ - /srv/borg/.ssh
+ - /srv/borg/repos
+...