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.

151 lines
4.2 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. `ansible-tendermint` is an [ansible](http://www.ansible.com/) role which:
  8. * installs tendermint
  9. * configures tendermint
  10. * configures tendermint service
  11. ## Requirements
  12. This role requires Ansible 2.0 or higher.
  13. ## Variables
  14. Here is a list of all the default variables for this role, which are also
  15. available in `defaults/main.yml`.
  16. ```
  17. tendermint_version: 0.9.0
  18. tendermint_archive: "tendermint_{{tendermint_version}}_linux_amd64.zip"
  19. tendermint_download: "https://s3-us-west-2.amazonaws.com/tendermint/{{tendermint_version}}/{{tendermint_archive}}"
  20. tendermint_download_folder: /tmp
  21. tendermint_user: tendermint
  22. tendermint_group: tendermint
  23. # Upstart start/stop conditions can vary by distribution and environment
  24. tendermint_upstart_start_on: start on runlevel [345]
  25. tendermint_upstart_stop_on: stop on runlevel [!345]
  26. tendermint_manage_service: true
  27. tendermint_use_upstart: true
  28. tendermint_use_systemd: false
  29. tendermint_upstart_template: "tendermint.conf.j2"
  30. tendermint_systemd_template: "tendermint.systemd.j2"
  31. tendermint_home: /opt/tendermint
  32. tendermint_node_port: 46656
  33. tendermint_rpc_port: 46657
  34. tendermint_proxy_app: "tcp://127.0.0.1:46658"
  35. tendermint_node_laddr: "tcp://0.0.0.0:{{tendermint_node_port}}"
  36. tendermint_rpc_laddr: "tcp://0.0.0.0:{{tendermint_rpc_port}}"
  37. tendermint_seeds: ""
  38. tendermint_fast_sync: true
  39. tendermint_db_backend: leveldb
  40. tendermint_log_level: notice
  41. tendermint_genesis_file: "{{tendermint_home}}/genesis.json"
  42. tendermint_abci: socket
  43. tendermint_skip_upnp: false
  44. tendermint_addrbook_file: "{{tendermint_home}}/addrbook.json"
  45. tendermint_addrbook_strict: true
  46. tendermint_pex_reactor: false
  47. tendermint_priv_validator_file: "{{tendermint_home}}/priv_validator.json"
  48. tendermint_db_dir: "{{tendermint_home}}/data"
  49. tendermint_grpc_laddr: ""
  50. tendermint_prof_laddr: ""
  51. tendermint_cs_wal_file: "{{tendermint_db_dir}}/cs.wal/wal"
  52. tendermint_cs_wal_light: false
  53. tendermint_filter_peers: false
  54. tendermint_block_size: 10000
  55. tendermint_block_part_size: 65536
  56. tendermint_disable_data_hash: false
  57. # all timeouts are in milliseconds
  58. tendermint_timeout_propose: 3000
  59. tendermint_timeout_propose_delta: 500
  60. tendermint_timeout_prevote: 1000
  61. tendermint_timeout_prevote_delta: 500
  62. tendermint_timeout_precommit: 1000
  63. tendermint_timeout_precommit_delta: 500
  64. tendermint_timeout_commit: 1000
  65. tendermint_skip_timeout_commit: false
  66. tendermint_mempool_recheck: true
  67. tendermint_mempool_recheck_empty: true
  68. tendermint_mempool_broadcast: true
  69. tendermint_mempool_wal_dir: "{{tendermint_db_dir}}/mempool.wal"
  70. tendermint_log_file: /var/log/tendermint.log
  71. tendermint_chain_id: mychain
  72. tendermint_genesis_time: "{{ansible_date_time.iso8601_micro}}"
  73. tendermint_validators: []
  74. ```
  75. ## Handlers
  76. These are the handlers that are defined in `handlers/main.yml`.
  77. * `restart tendermint`
  78. * `reload systemd`
  79. ## Example playbook that configures a Tendermint on Ubuntu 14.04
  80. ```
  81. ---
  82. - hosts: all
  83. vars:
  84. tendermint_chain_id: MyAwesomeChain
  85. tendermint_seeds: "172.13.0.1:46656,172.13.0.2:46656,172.13.0.3:46656"
  86. roles:
  87. - ansible-tendermint
  88. ```
  89. This playbook will install Tendermint and will create all the
  90. required directories. But **it won't start the Tendermint if no
  91. validators were given**.
  92. You will need to collect validators public keys manually or using
  93. `collect_public_keys.yml` given you have SSH access to all the nodes and set `tendermint_validators` variable:
  94. ```
  95. ---
  96. - hosts: all
  97. vars:
  98. tendermint_chain_id: MyAwesomeChain
  99. tendermint_seeds: "172.13.0.1:46656,172.13.0.2:46656,172.13.0.3:46656"
  100. tendermint_validators:
  101. - pub_key:
  102. - 1
  103. - 1F017E488A6327FAFBBE092193B427912E117733DE6AF72150BF09AA58411E7F
  104. amount: 10
  105. name: paris
  106. roles:
  107. - ansible-tendermint
  108. ```
  109. ### Example playbook that configures a Tendermint with in-proc dummy app
  110. ```
  111. ---
  112. - hosts: all
  113. vars:
  114. tendermint_chain_id: MyAwesomeChain
  115. tendermint_proxy_app: dummy
  116. roles:
  117. - ansible-tendermint
  118. ```
  119. ## Testing
  120. ```
  121. vagrant up
  122. ```