aboutsummaryrefslogtreecommitdiff
path: root/tasks/common.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/common.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 '')
-rw-r--r--tasks/common.yml25
1 files changed, 25 insertions, 0 deletions
diff --git a/tasks/common.yml b/tasks/common.yml
new file mode 100644
index 0000000..057cd25
--- /dev/null
+++ b/tasks/common.yml
@@ -0,0 +1,25 @@
+---
+- name: set distro-specific server variables
+ include_vars: '{{ ansible_os_family }}.yml'
+
+- name: Check if borg is supported on distro
+ fail:
+ msg: "borg tasks are not supported on this operating system yet."
+ when: borg_packages is not defined
+
+- name: Ensure borg is installed
+ package:
+ name: "{{ borg_packages }}"
+
+- name: Push borg gathering fact on client
+ copy:
+ src: borg.fact
+ dest: /etc/ansible/facts.d/
+ mode: 0500
+ owner: root
+ register: borg_gathering_fact
+
+- name: reload ansible_local
+ setup: filter=ansible_local
+ when: borg_gathering_fact.changed
+...