Commit ebc1636d by Julien Muchembled

NEO: instanciate a single admin node, by default in the first subpartition

1 parent 9177c5b2
......@@ -56,24 +56,32 @@ config-upstream-cluster = {{ dumps(parameter_dict.get('upstream-cluster', '')) }
config-upstream-masters = {{ dumps(parameter_dict.get('upstream-masters', '')) }}
software-type = {{ software_type }}
{% set node_list = parameter_dict.get('node-list', ({},)) -%}
{% set storage_count = [] -%}
{% set storage_count = [] -%}
{% for node in node_list -%}
{% do storage_count.append(node.get('storage-count', 1)) -%}
{% endfor -%}
config-autostart = {{ dumps(sum(storage_count)) }}
{% do assert(replicas < len(node_list)) -%}
{% for i, node in enumerate(node_list) -%}
{% set section_id = prefix ~ i -%}
{% do section_id_list.append(section_id) -%}
{%- do assert(replicas < len(node_list)) %}
{%- set admin_list = [] %}
{%- for i, node in enumerate(node_list) %}
{%- set section_id = prefix ~ i %}
{%- do section_id_list.append(section_id) %}
{%- if admin_list %}
{%- do node.setdefault('admin', 0) %}
{%- endif %}
[{{section_id}}]
<= {{ prefix }}request-common
name = {{ section_id }}
{% for k, v in node.iteritems() -%}
{%- if node.get('admin') != 0 %}
{%- do admin_list.append(node) %}
{%- endif %}
{%- for k, v in node.iteritems() %}
config-{{ k }} = {{ dumps(v) }}
{% endfor -%}
{%- endfor %}
{{ sla(section_id) }}
{% endfor -%}
{%- endfor %}
{%- do assert(len(admin_list) == 1, admin_list) %}
[{{section(prefix ~ 'cluster')}}]
recipe = slapos.cookbook:neoppod.cluster
......
......@@ -112,7 +112,7 @@ adapter-context =
[root-common]
<= download-base-neo
md5sum = 15fa47a59cc3019f59612aaf33bd9ec5
md5sum = 22ae2edfcbc7b7ef2a3128cb75e9f456
[instance-neo-admin]
<= download-base-neo
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!