---
|
|
|
|
- name: copy genesis file
|
|
template: >
|
|
src=genesis.json.j2
|
|
dest={{tendermint_home}}/genesis.json
|
|
owner={{tendermint_user}}
|
|
group={{tendermint_group}}
|
|
mode=0644
|
|
register: genesis_file_copied
|
|
|
|
- name: get validators number from genesis file
|
|
shell: cat {{tendermint_home}}/genesis.json | jq ".validators | length"
|
|
register: num_validators
|
|
when: genesis_file_copied|changed
|
|
|
|
- name: restart tendermint if number of validators greater than 0
|
|
shell: echo "restarting ..."
|
|
when: genesis_file_copied|changed and num_validators.stdout|int > 0
|
|
notify: restart tendermint
|
|
|
|
- service: >
|
|
name=tendermint
|
|
state=started
|
|
enabled=yes
|
|
when: tendermint_manage_service
|