You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
703 B

---
- 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