Commit ebc1636d authored by Julien Muchembled's avatar Julien Muchembled

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

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