backup parity

This commit is contained in:
Vitaly Znachenok 2017-12-29 16:10:57 +03:00
parent d1408b8a80
commit 61e105467a
3 changed files with 43 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
files/*.pub
*.retry
group_vars/all
hosts

View File

@ -0,0 +1,31 @@
---
- name: Shutdown poa-netstats service
service: name=poa-netstats state=stopped
- name: Shutdown poa-parity service
service: name=poa-parity state=stopped
- name: Create backup directory
file: path=/data state=directory
- name: Create blockchain archive
archive:
format: gz
path: /home/moc/parity_data
dest: "/data/parity_data-{{ date }}.tar.gz"
- name: Upload to s3
s3:
aws_access_key: "{{ access_key }}"
aws_secret_key: "{{ secret_key }}"
bucket: "{{ s3_bucket }}"
object: "/parity_data-{{ date }}.tar.gz"
src: "/data/parity_data-{{ date }}.tar.gz"
mode: put
- name: Launch poa-parity service
service: name=poa-parity state=started
- name: Launch poa-netstats service
service: name=poa-netstats state=started

8
site.yml Normal file
View File

@ -0,0 +1,8 @@
- hosts: backup
vars:
date: "{{ lookup('pipe', 'date +%Y%m%d-%H%M') }}"
s3_bucket: "poa-backups"
user: root
roles:
- backup-parity
tags: backup