Browse Source

fixes

pull/1943/head
Greg Szabo 8 years ago
parent
commit
464b404f48
3 changed files with 6 additions and 10 deletions
  1. +1
    -0
      ansible/install.yml
  2. +3
    -8
      ansible/roles/config/tasks/main.yml
  3. +2
    -2
      ansible/roles/config/templates/genesis-server.json.j2

+ 1
- 0
ansible/install.yml View File

@ -3,6 +3,7 @@
#variable "service" is required
- hosts: "{{ lookup('env','TF_VAR_TESTNET_NAME') }}:tag_Environment_{{ lookup('env','TF_VAR_TESTNET_NAME') }}"
any_errors_fatal: true
roles:
- install
- {role: generic-service, when: service == 'tendermint'}


+ 3
- 8
ansible/roles/config/tasks/main.yml View File

@ -2,23 +2,18 @@
- name: gather tendermint public keys
when: (validators == true or validators == 'true') and tendermint_genesis_file is not defined
command: "sudo -Hu {{service}} tendermint show_validator --home /etc/{{service}}/tendermint --log_level error"
# become: yes
# become_user: "{{service}}"
command: "/usr/bin/tendermint show_validator --home /etc/{{service}}/tendermint --log_level error"
register: pubkeys
changed_when: false
- debug: var=((groups[testnet_name]|default([]))+(groups['tag_Environment_'~testnet_name]|default([])))
- debug: var=pubkeys
- name: resetting permissions from root after gathering public keys
file: "path=/etc/{{service}}/tendermint owner={{service}} group={{service}} recurse=yes"
- name: register tendermint public keys as host facts
when: (validators == true or validators == 'true') and tendermint_genesis_file is not defined
set_fact: "pubkey='{{pubkeys.stdout}}'"
connection: local
- debug: var=hostvars[inventory_hostname]["pubkey"]
- debug: var=hostvars[inventory_hostname]["pubkey"]["data"]
- name: copy generated tendermint genesis.json - genesis_time will be updated
when: (validators == true or validators == 'true') and tendermint_genesis_file is not defined
template:


+ 2
- 2
ansible/roles/config/templates/genesis-server.json.j2 View File

@ -3,7 +3,7 @@
"chain_id":"{{testnet_name}}",
"validators":
[
{% if (validators == true or validators == 'true') %}
{% if (validators == true) or (validators == 'true') %}
{% set comma = joiner(",") %}
{% for host in (groups[testnet_name]|default([]))+(groups['tag_Environment_'~testnet_name]|default([])) %}
{{ comma() }}
@ -13,7 +13,7 @@
"type": "{{hostvars[host]["pubkey"]["type"]}}"
},
"amount":10,
"name":"{{hostvars[host]["ansible_hostname"]}}"
"name":"{{hostvars[host]["inventory_hostname"]}}"
}
{% endfor %}
{% endif %}


Loading…
Cancel
Save