Commit fd805cfa authored by David Nowell's avatar David Nowell
Browse files

Adding auto restore to Ansible role

parent b9ced638
---
# tasks file for sample-app-role
# tasks file for Gitlab build
- name: Install LVM
yum:
......@@ -263,10 +263,18 @@
notify:
- Restart NRPE
#############################################################################
- block:
#############################################################################
- name: Restore Gitlab
command: /usr/local/bin/restore-gitlab.sh
when: restore is defined and restore == "yes"
# This is how to do a restore (as root). Should also be documented somewhere else:
# This is how to do a restore (as root). In /usr/local/bin/restore-gitlab.sh
# gitlab-ctl stop unicorn
# gitlab-ctl stop sidekiq
#
......
......@@ -8,14 +8,14 @@ aws s3 cp s3://{{ s3_bucket }}/${BAKFILE} /var/opt/gitlab/backups
chown git:git /var/opt/gitlab/backups/*.tar
KEYFILE=`aws s3 ls {{ s3_bucket }} | grep gitback-ssh-host-keys | tail -1 | awk '{print $4}'`
KEYFILE=`aws s3 ls {{ s3_bucket }} | grep gitback-sshkeys | tail -1 | awk '{print $4}'`
aws s3 cp s3://{{ s3_bucket }}/${KEYFILE} /etc/ssh/
cd /etc/ssh; tar -xf ${KEYFILE}
BAKNAME=`echo ${BAKFILE/_gitlab_backup.tar/}`
gitlab-rake gitlab:backup:restore BACKUP=${BAKNAME}
gitlab-rake gitlab:backup:restore BACKUP=${BAKNAME} force=yes
gitlab-ctl start unicorn
gitlab-ctl start sidekiq
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment