Add role to do HF on spec changes

This commit is contained in:
phahulin 2018-01-08 21:39:55 +03:00
parent 8de52019b8
commit 1984be7db8
4 changed files with 39 additions and 0 deletions

View File

@ -6,3 +6,7 @@ access_key: "KEY_NAME"
secret_key: "KEY_SECRET"
s3_bucket: "BUCKET_NAME"
#For HFs
MAIN_REPO_FETCH: "poanetwork"
GENESIS_BRANCH: "sokol"

View File

@ -1,2 +1,5 @@
[backup]
INSERT_HERE_SERVERS_HOSTNAME_OR_IPs
[hf-spec-change]
INSERT_HERE_SERVERS_HOSTNAME_OR_IPs

View File

@ -0,0 +1,23 @@
---
- name: Shutdown poa-netstats service
service: name=poa-netstats state=stopped
- name: Shutdown poa-parity service
service: name=poa-parity state=stopped
- name: Create directory for spec backups
file: path={{ home }}/spec-hfs state=directory
- name: Create previous spec backup
command: cp {{ home }}/spec.json {{ home }}/spec-hfs/spec-hf-{{ date }}.json
- name: Download new spec
get_url: url={{ item }} dest={{ home }}/ mode=0644
with_items:
- "https://raw.githubusercontent.com/{{ MAIN_REPO_FETCH }}/poa-chain-spec/{{ GENESIS_BRANCH }}/spec.json"
- name: Launch poa-parity service
service: name=poa-parity state=started
- name: Launch poa-netstats service
service: name=poa-netstats state=started

View File

@ -5,3 +5,12 @@
roles:
- backup-parity
tags: backup
- hosts: hf-spec-change
vars:
date: "{{ lookup('pipe', 'date -u +%Y%m%d-%H%M%S') }}"
home: "/home/{{ poa_role }}"
user: root
roles:
- hf-spec-change
tags: hf-spec