muawiakh 241af47a32 Automation of multi node BigchainDB deployment for dev/test
- Setup single/multi node BigchainDB cluster using
  - Vagrant
  - Ansible
- Updated documentation
2017-11-16 12:51:46 +01:00

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 -%}