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.

91 lines
2.3 KiB

8 years ago
  1. # Ansible role for Tendermint
  2. ![Ansible plus Tendermint](img/a_plus_t.png)
  3. * [Requirements](#requirements)
  4. * [Variables](#variables)
  5. * [Handlers](#handlers)
  6. * [Example playbook that configures a Tendermint on Ubuntu](#example-playbook-that-configures-a-tendermint-on-ubuntu)
  7. ## Requirements
  8. This role requires Ansible 2.0 or higher.
  9. ## Variables
  10. Here is a list of all the default variables for this role, which are also
  11. available in `defaults/main.yml`.
  12. ```
  13. tendermint_version: 0.9.0
  14. tendermint_archive: "tendermint_{{tendermint_version}}_linux_amd64.zip"
  15. tendermint_download: "https://s3-us-west-2.amazonaws.com/tendermint/{{tendermint_version}}/{{tendermint_archive}}"
  16. tendermint_download_folder: /tmp
  17. tendermint_user: tendermint
  18. tendermint_group: tendermint
  19. # Upstart start/stop conditions can vary by distribution and environment
  20. tendermint_upstart_start_on: start on runlevel [345]
  21. tendermint_upstart_stop_on: stop on runlevel [!345]
  22. tendermint_manage_service: true
  23. tendermint_home: /opt/tendermint
  24. tendermint_rpc_port: 46657
  25. tendermint_proxy_app: tcp://127.0.0.1:46658
  26. tendermint_log_file: /var/log/tendermint.log
  27. tendermint_chain_id: mychain
  28. tendermint_genesis_time: "{{ansible_date_time.iso8601_micro}}"
  29. ```
  30. You can also change `templates/config.toml.j2` to suit your needs.
  31. ## Handlers
  32. These are the handlers that are defined in `handlers/main.yml`.
  33. * restart tendermint
  34. ## Example playbook that configures a Tendermint on Ubuntu
  35. ```
  36. ---
  37. - hosts: all
  38. vars:
  39. tendermint_chain_id: MyAwesomeChain
  40. tendermint_seeds: "172.13.0.1:46656,172.13.0.2:46656,172.13.0.3:46656"
  41. roles:
  42. - ansible-tendermint
  43. ```
  44. This playbook will install Tendermint and will create all the required
  45. directories. But **it won't start the Tendermint if there are no validators in
  46. genesis file**. See `templates/genesis.json.j2`.
  47. You will need to collect validators public keys manually or using
  48. `collect_public_keys.yml` given you have SSH access to all the nodes and add
  49. them to `templates/genesis.json.j2`:
  50. ```
  51. {
  52. "app_hash": "",
  53. "chain_id": "{{tendermint_chain_id}}",
  54. "genesis_time": "{{tendermint_genesis_time}}",
  55. "validators": [
  56. {
  57. "pub_key": [1, "3A4B5F5C34B19E5DBD2DC68E7D6FF7F46859A0657EDCA3274235A7EB127A0706"],
  58. "amount": 10,
  59. "name": "1"
  60. }
  61. ]
  62. }
  63. ```
  64. ## Testing
  65. ```
  66. vagrant up
  67. ```