mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00

- Setup single/multi node BigchainDB cluster using - Vagrant - Ansible - Updated documentation
21 lines
636 B
Django/Jinja
21 lines
636 B
Django/Jinja
{%- set keyring = [] -%}
|
|
{%- set bdb_config_path = {'path': ''} -%}
|
|
{%- for host in bdb_hosts -%}
|
|
{%- if host["name"] != ansible_hostname -%}
|
|
{{- keyring.append(hostvars[host["name"]]["pub_key"]) -}}
|
|
{%- else -%}
|
|
{%- if bdb_config_path.update({'path': hostvars[host["name"]]["bdb_config"]}) -%}
|
|
{%- endif -%}
|
|
{%- endif -%}
|
|
{%- endfor -%}
|
|
{%- if keyring|length != 0 -%}
|
|
#!/usr/bin/python
|
|
import json
|
|
with open('{{ bdb_config_path['path'] }}', 'r+') as f:
|
|
data = json.load(f)
|
|
del data['keyring'][:]
|
|
data['keyring'] = {{ keyring }}
|
|
f.seek(0)
|
|
json.dump(data, f, indent=4)
|
|
f.truncate()
|
|
{%- endif -%} |