Browse Source

node ID fix

pull/1943/head
Greg Szabo 7 years ago
parent
commit
7d414cb7b2
3 changed files with 26 additions and 13 deletions
  1. +11
    -11
      ansible/README.rst
  2. +2
    -2
      ansible/group_vars/all
  3. +13
    -0
      ansible/roles/config/tasks/main.yml

+ 11
- 11
ansible/README.rst View File

@ -9,8 +9,8 @@ Using Ansible
The playbooks in `our ansible directory <https://github.com/tendermint/tools/tree/master/ansible>`__
run ansible `roles <http://www.ansible.com/>`__ which:
- install and configure basecoin or ethermint
- start/stop basecoin or ethermint and reset their configuration
- install and configure basecoind or ethermint
- start/stop basecoind or ethermint and reset their configuration
Prerequisites
-------------
@ -200,7 +200,7 @@ DigitalOcean
DO_API_TOKEN="<The API token received from DigitalOcean>"
TF_VAR_TESTNET_NAME="testnet-servers"
ansible-playbook -i inventory/digital_ocean.py install.yml -e service=basecoin
ansible-playbook -i inventory/digital_ocean.py install.yml -e service=basecoind
Amazon AWS
~~~~~~~~~~
@ -210,12 +210,12 @@ Amazon AWS
AWS_ACCESS_KEY_ID='<The API access key ID received from Amazon>'
AWS_SECRET_ACCESS_KEY='<The API secret access key received from Amazon>'
TF_VAR_TESTNET_NAME="testnet-servers"
ansible-playbook -i inventory/ec2.py install.yml -e service=basecoin
ansible-playbook -i inventory/ec2.py install.yml -e service=basecoind
Installing custom versions
~~~~~~~~~~~~~~~~~~~~~~~~~~
By default ansible installs the tendermint, basecoin or ethermint binary
By default ansible installs the tendermint, basecoind or ethermint binary
versions from the latest release in the repository. If you build your
own version of the binaries, you can tell ansible to install that
instead.
@ -223,11 +223,11 @@ instead.
::
GOPATH="<your go path>"
go get -u github.com/tendermint/basecoin/cmd/basecoin
go get -u github.com/tendermint/basecoin/cmd/basecoind
DO_API_TOKEN="<The API token received from DigitalOcean>"
TF_VAR_TESTNET_NAME="testnet-servers"
ansible-playbook -i inventory/digital_ocean.py install.yml -e service=basecoin -e release_install=false
ansible-playbook -i inventory/digital_ocean.py install.yml -e service=basecoind -e release_install=false
Alternatively you can change the variable settings in
``group_vars/all``.
@ -237,15 +237,15 @@ Other commands and roles
There are few extra playbooks to make life easier managing your servers.
- install.yml - Install basecoin or ethermint applications. (Tendermint
- install.yml - Install basecoind or ethermint applications. (Tendermint
gets installed automatically.) Use the ``service`` parameter to
define which application to install. Defaults to ``basecoin``.
define which application to install. Defaults to ``basecoind``.
- reset.yml - Stop the application, reset the configuration and data,
then start the application again. You need to pass
``-e service=<servicename>``, like ``-e service=basecoin``. It will
``-e service=<servicename>``, like ``-e service=basecoind``. It will
restart the underlying tendermint application too.
- restart.yml - Restart a service on all nodes. You need to pass
``-e service=<servicename>``, like ``-e service=basecoin``. It will
``-e service=<servicename>``, like ``-e service=basecoind``. It will
restart the underlying tendermint application too.
- stop.yml - Stop the application. You need to pass
``-e service=<servicename>``.


+ 2
- 2
ansible/group_vars/all View File

@ -9,8 +9,8 @@
## install
##
## service variable defines which service is going to be managed. It can be set to basecoin or ethermint.
service: basecoin
## service variable defines which service is going to be managed. It can be set to basecoind or ethermint.
service: basecoind
## release_install indicates if the install role should look for a privately built binary after installing the service package. If set to false, the privately built binary in the GOPATH is going to override the binary on the target systems.
#release_install: true


+ 13
- 0
ansible/roles/config/tasks/main.yml View File

@ -7,6 +7,13 @@
register: pubkeys
changed_when: false
- name: gather tendermint peer IDs
when: genesis_file is not defined
tags: reconfig-toml
command: "/usr/bin/tendermint show_node_id --home /etc/{{service}} --log_level error"
register: nodeids
changed_when: false
- name: resetting permissions from root after gathering public keys
tags: reconfig-toml,reconfig-genesis
file: "path=/etc/{{service}} owner={{service}} group={{service}} recurse=yes"
@ -17,6 +24,12 @@
set_fact: "pubkey='{{pubkeys.stdout}}'"
connection: local
- name: register node ids as host facts
when: genesis_file is not defined
tags: reconfig-toml
set_fact: "nodeid='{{nodeids.stdout}}'"
connection: local
- name: copy generated genesis.json - genesis_time will be updated
when: (validators == true or validators == 'true') and (genesis_file is not defined)
tags: reconfig-genesis


Loading…
Cancel
Save