summaryrefslogtreecommitdiff
path: root/baserock_backup/instance-config.yml
diff options
context:
space:
mode:
Diffstat (limited to 'baserock_backup/instance-config.yml')
-rw-r--r--baserock_backup/instance-config.yml38
1 files changed, 38 insertions, 0 deletions
diff --git a/baserock_backup/instance-config.yml b/baserock_backup/instance-config.yml
new file mode 100644
index 00000000..8ccbb584
--- /dev/null
+++ b/baserock_backup/instance-config.yml
@@ -0,0 +1,38 @@
+# Configuration for a machine that runs data backups of baserock.org.
+#
+# The current backup machine is not a reproducible deployment, but this
+# playbook should be easily adaptable to produce a properly reproducible
+# one.
+---
+- hosts: baserock-backup1
+ gather_facts: false
+ tasks:
+ - name: user for running backups
+ user: name=backup
+
+ # You'll need to copy in the SSH key manually for this user.
+
+ - name: SSH config for backup user
+ copy: src=ssh_config dest=/home/backup/.ssh/config
+
+ - name: backup script
+ copy: src=backup.sh dest=/home/backup/backup.sh mode=755
+
+ # You will need https://github.com/ansible/ansible-modules-core/pull/986
+ # for this to work.
+ - name: backup cron job, runs every day at midnight
+ cron:
+ hour: 00
+ minute: 00
+ job: /home/backup/backup.sh
+ name: baserock.org data backup
+ user: backup
+
+ # As the .service file says, running the backup script via 'cron' is
+ # a workaround for what may be a bug in systemd. I don't have the energy
+ # to investigate the problem right now.
+ - name: .service file for Busybox 'cron' daemon
+ copy: src=crond.service dest=/etc/systemd/system mode=644
+
+ - name: service for Busybox 'cron' daemon
+ service: name=crond enabled=yes state=started