summaryrefslogtreecommitdiff
path: root/ansible/roles/trove-setup/tasks/backups.yml
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-06-18 10:16:41 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-07-14 15:02:10 +0000
commite6bf7b4b32d477352cf45b4b0abb6993d524f78a (patch)
tree1a640eb2acd18e903e85923bab3fcd7d3e40392e /ansible/roles/trove-setup/tasks/backups.yml
parent49ddac4e61b6dca7e4b794cf639b0a1b3d86db00 (diff)
downloadtrove-setup-e6bf7b4b32d477352cf45b4b0abb6993d524f78a.tar.gz
Add Ansible scripts
Diffstat (limited to 'ansible/roles/trove-setup/tasks/backups.yml')
-rw-r--r--ansible/roles/trove-setup/tasks/backups.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/ansible/roles/trove-setup/tasks/backups.yml b/ansible/roles/trove-setup/tasks/backups.yml
new file mode 100644
index 0000000..65a1466
--- /dev/null
+++ b/ansible/roles/trove-setup/tasks/backups.yml
@@ -0,0 +1,16 @@
+# Depends on:
+# - check.yml
+---
+- name: Create the backups user if TROVE_BACKUP_KEYS is defined
+ user: name=backup comment="Backup user" shell=/bin/sh home=/root/backup-user-home group=root uid=0 non_unique=yes
+ when: TROVE_BACKUP_KEYS is defined
+
+- name: Creates the .ssh directory to the backups user if TROVE_BACKUP_KEYS is defined
+ file: path=/root/backup-user-home/.ssh state=directory
+ when: TROVE_BACKUP_KEYS is defined
+
+- name: Copy the TROVE_BACKUP_KEYS if defined to authorized_keys of the backup user
+ shell: |
+ cat {{ TROVE_BACKUP_KEYS }} >> /root/backup-user-home/.ssh/authorized_keys
+ creates=/root/backup-user-home/.ssh/authorized_keys
+ when: TROVE_BACKUP_KEYS is defined