upd-parity-version for 1.10

This commit is contained in:
phahulin 2018-03-28 13:55:27 +03:00
parent 7d4154879b
commit 869b4e3503
3 changed files with 39 additions and 18 deletions

1
.gitignore vendored
View File

@ -19,3 +19,4 @@ logs/old/*.log
logs/old/*.gz
*.todo
all

View File

@ -3,8 +3,12 @@
poa_role: "bootnode"
# repo to fetch new binaries from
PARITY_BIN_LOC: "http://d1h4xl4cr1h0mo.cloudfront.net/v1.9.2/x86_64-unknown-linux-gnu/parity"
PARITY_BIN_SHA256: "3604a030388cd2c22ebe687787413522106c697610426e09b3c5da4fe70bbd33"
PARITY_BIN_LOC_UBUNTU: "http://d1h4xl4cr1h0mo.cloudfront.net/v1.10.0/x86_64-unknown-linux-gnu/parity"
PARITY_BIN_SHA256_UBUNTU: "3871bae2760050316c9c1131750a2dc3fd11e1b79cd5f7a1e09015264d4c5ea0"
PARITY_BIN_LOC_CENTOS: "http://d1h4xl4cr1h0mo.cloudfront.net/v1.10.0/x86_64-unknown-centos-gnu/parity"
PARITY_BIN_SHA256_CENTOS: "fd21f563a1bbce6fb5f995403946ad5dd8506d4781bddac12b26ba3249af4fe9"
PARITY_VERSION_CHECK: "1.10.0"
# backup options
backup_parity_data: "on"
@ -13,15 +17,13 @@ backup_parity_data: "on"
resync: "off"
# strings to remove from node.toml
bootnode_node_toml_lines_to_remove:
- section: "rpc"
option: "threads"
bootnode_node_toml_lines_to_remove: []
# strings to add in node.toml
bootnode_node_toml_lines_to_add:
- section: "rpc"
option: "processing_threads"
value: 4
- section: "rpc"
option: "cors"
value: ['all']
- section: "ui"
option: "disable"
value: "true"
- section: "dapps"
option: "disable"
value: "true"

View File

@ -10,6 +10,22 @@
path: /etc/systemd/system/poa-netstats.service
register: netstats_service_file
### checks for PARITY_VERSION_CHECK
- name: Check if previous backups are present
stat: path="{{ home }}/backups-version/BEFORE-{{ PARITY_VERSION_CHECK }}"
register: bkp_version
- name: Remove previous version backups
file: path="{{ home }}/backups-version" state=absent
when: bkp_version.stat.exists == False
- name: Create directory for parity-version backups
file: path="{{ backups_folder }}" state=directory
- name: Create backups version file
file: path="{{ home }}/backups-version/BEFORE-{{ PARITY_VERSION_CHECK }}" state=touch
### actual upgrade
- name: Shutdown poa-netstats service
service: name=poa-netstats state=stopped
when: netstats_service_file.stat.exists
@ -17,9 +33,6 @@
- name: Shutdown poa-parity service
service: name=poa-parity state=stopped
- name: Create directory for parity-version backups
file: path="{{ backups_folder }}" state=directory
- name: Backup parity binary
command: cp -a {{ home }}/parity {{ backups_folder }}/parity
@ -30,10 +43,15 @@
- name: Backup node.toml
command: cp -a "{{ home }}/node.toml" {{ backups_folder }}/node.toml
- name: Download new parity binary version
get_url: url="{{ PARITY_BIN_LOC }}" dest="{{ home }}/parity" mode=0755 checksum="sha256:{{ PARITY_BIN_SHA256 }}"
- name: Download new parity binary version (Debian-like)
get_url: url="{{ PARITY_BIN_LOC_UBUNTU }}" dest="{{ home }}/parity" mode=0755 checksum="sha256:{{ PARITY_BIN_SHA256_UBUNTU }}"
when: ansible_os_family == "Debian"
- name: Remove lines from node.toml (bootnode)
- name: Download new parity binary version (RedHat-like)
get_url: url="{{ PARITY_BIN_LOC_CENTOS }}" dest="{{ home }}/parity" mode=0755 checksum="sha256:{{ PARITY_BIN_SHA256_CENTOS }}"
when: ansible_os_family == "RedHat"
- name: Remove lines from node.toml (bootnode only)
ini_file:
path: "{{ home }}/node.toml"
section: "{{ item['section'] }}"
@ -42,7 +60,7 @@
with_items: "{{ bootnode_node_toml_lines_to_remove }}"
when: poa_role == "bootnode"
- name: Add lines to node.toml (bootnode)
- name: Add lines to node.toml (bootnode only)
ini_file:
path: "{{ home }}/node.toml"
value: "{{ item['value'] }}"