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.

65 lines
2.9 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. ---
  2. - name: gather tendermint public keys
  3. when: (validators == true or validators == 'true') and tendermint_genesis_file is not defined
  4. command: "/usr/bin/tendermint show_validator --home /etc/{{service}}/tendermint --log_level error"
  5. register: pubkeys
  6. changed_when: false
  7. - name: resetting permissions from root after gathering public keys
  8. file: "path=/etc/{{service}}/tendermint owner={{service}} group={{service}} recurse=yes"
  9. - name: register tendermint public keys as host facts
  10. when: (validators == true or validators == 'true') and tendermint_genesis_file is not defined
  11. set_fact: "pubkey='{{pubkeys.stdout}}'"
  12. connection: local
  13. - name: copy generated tendermint genesis.json - genesis_time will be updated
  14. when: (validators == true or validators == 'true') and tendermint_genesis_file is not defined
  15. template:
  16. src: genesis-server.json.j2
  17. dest: "/etc/{{service}}/tendermint/genesis.json"
  18. owner: "{{service}}"
  19. group: "{{service}}"
  20. - name: copy generated service genesis.json - genesis_time will be updated
  21. when: (validators == true or validators == 'true') and (service_genesis_file is not defined) and (service != 'ethermint')
  22. template:
  23. src: genesis-service.json.j2
  24. dest: "/etc/{{service}}/genesis.json"
  25. owner: "{{service}}"
  26. group: "{{service}}"
  27. - name: copy pre-created tendermint genesis.json
  28. when: tendermint_genesis_file is defined
  29. copy: "src={{tendermint_genesis_file}} dest=/etc/{{service}}/tendermint/genesis.json owner={{service}} group={{service}}"
  30. - name: copy pre-created service genesis.json
  31. when: service_genesis_file is defined
  32. copy: "src={{service_genesis_file}} dest=/etc/{{service}}/genesis.json owner={{service}} group={{service}}"
  33. - name: copy tendermint config.toml
  34. tags: reconfig-toml
  35. when: validators == true or validators == 'true'
  36. template:
  37. src: config.toml.j2
  38. dest: "/etc/{{service}}/tendermint/config.toml"
  39. owner: "{{service}}"
  40. group: "{{service}}"
  41. - name: Copy validator network files for non-validators
  42. when: validators == false or validators == 'false'
  43. get_url: "url={{item['src']}} dest={{item['dst']}} force=yes"
  44. with_items:
  45. - { src: "https://raw.githubusercontent.com/tendermint/testnets/master/{{validator_network}}/{{service}}/genesis.json" , dst: "/etc/{{service}}/genesis.json" }
  46. - { src: "https://raw.githubusercontent.com/tendermint/testnets/master/{{validator_network}}/tendermint/genesis.json" , dst: "/etc/{{service}}/tendermint/genesis.json" }
  47. - { src: "https://raw.githubusercontent.com/tendermint/testnets/master/{{validator_network}}/tendermint/config.toml" , dst: "/etc/{{service}}/tendermint/config.toml" }
  48. - name: Set validator network files permissions for non-validators
  49. when: validators == false or validators == 'false'
  50. file: "path={{item}} owner={{service}} group={{service}}"
  51. with_items:
  52. - "/etc/{{service}}/genesis.json"
  53. - "/etc/{{service}}/tendermint/genesis.json"
  54. - "/etc/{{service}}/tendermint/config.toml"