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.

20 lines
601 B

  1. ---
  2. - name: copy genesis file
  3. template: >
  4. src=genesis.json.j2
  5. dest={{tendermint_home}}/genesis.json
  6. owner={{tendermint_user}}
  7. group={{tendermint_group}}
  8. mode=0644
  9. register: genesis_file_copied
  10. - name: get validators number from genesis file
  11. shell: cat {{tendermint_home}}/genesis.json | jq ".validators | length"
  12. register: num_validators
  13. when: genesis_file_copied|changed
  14. - name: restart tendermint if number of validators greater than 0
  15. shell: echo "restarting ..."
  16. when: genesis_file_copied|changed and num_validators.stdout|int > 0
  17. notify: restart tendermint