ansible: Migrate staking key of AVA service to new location

Refs #145
This commit is contained in:
Alex Willmer 2020-05-12 23:08:16 +01:00
parent 74588da411
commit a92630631a
3 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,49 @@
- name: Migrate staking key
vars:
old_key: "{{ ava_daemon_data_dir }}/keys/staker.key"
new_key: "{{ ava_daemon_data_dir }}/staking/staker.key"
block:
- name: Check for Gecko 0.2.0 staking key
stat:
path: "{{ old_key }}"
register: gecko_0_2_0_staking_key
- name: Check for Gecko newer staking key
stat:
path: "{{ new_key }}"
register: gecko_newer_staking_key
- name: Move staking key
command:
cmd: mv "{{ old_key }}" "{{ new_key }}"
creates: "{{ new_key }}"
when:
- gecko_0_2_0_staking_key.stat.exists
- not gecko_newer_staking_key.stat.exists
notify:
- Restart AVA service
- name: Migrate staking certificate
vars:
old_cert: "{{ ava_daemon_data_dir }}/keys/staker.crt"
new_cert: "{{ ava_daemon_data_dir }}/staking/staker.crt"
block:
- name: Check for Gecko 0.2.0 staking certificate
stat:
path: "{{ old_cert }}"
register: gecko_0_2_0_staking_cert
- name: Check for Gecko newer staking certificate
stat:
path: "{{ new_cert }}"
register: gecko_newer_staking_cert
- name: Migrate staking certificate
command:
cmd: mv "{{ old_cert }}" "{{ new_cert }}"
creates: "{{ new_cert }}"
when:
- gecko_0_2_0_staking_cert.stat.exists
- not gecko_newer_staking_cert.stat.exists
notify:
- Restart AVA service

View File

@ -0,0 +1 @@
- import_tasks: 10-staking-migrate.yml

View File

@ -6,4 +6,5 @@
- name: ava-build
- name: ava-user
- name: ava-install
- name: ava-upgrade
- name: ava-service