Commit ef01a678 authored by Hardik Juneja's avatar Hardik Juneja

stack: Use monitor-base-url-dict section to collect monitor-urls and fix password storage_path

parent 8dac1383
......@@ -23,15 +23,15 @@ md5sum = 744d99b226fb3e31ea2108288d2d21a0
[template-kumofs]
filename = instance-kumofs.cfg.in
md5sum = 4188476e65f2f7751c15a92143a64559
md5sum = 253027f37c4e5bd908e6af551848f03a
[template-cloudooo]
filename = instance-cloudoo.cfg.in
md5sum = 902fee5c1fa411efb2da732088e794d1
md5sum = 43253cbfd5d361047ba6a99b116b2370
[template-zope-conf]
filename = zope.conf.in
md5sum = 750268dc44f83bdcb68cd77b50ca240b
md5sum = 77ab4f229a92e02603028a0bd3772edd
[site-zcml]
filename = site.zcml
......@@ -79,7 +79,7 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e
[template-erp5]
filename = instance-erp5.cfg.in
md5sum = 236170c37b0fb549a7482f3745c4c0d2
md5sum = b3fc9c8721885dbffe37cc590fed3a6e
[template-zeo]
filename = instance-zeo.cfg.in
......@@ -87,7 +87,7 @@ md5sum = 2248d249cfc53c73e7c65665d4d53be0
[template-zope]
filename = instance-zope.cfg.in
md5sum = adc5113787310f282a9c8d1ce33224b9
md5sum = 6a64d1615c3ef9f6311c863d5aa0c58f
[template-balancer]
filename = instance-balancer.cfg.in
......
......@@ -8,7 +8,7 @@
{% set jupyter_dict = slapparameter_dict.get('jupyter', {}) -%}
{% set has_jupyter = jupyter_dict.get('enable', jupyter_enable_default.lower() in ('true', 'yes')) -%}
{% set jupyter_zope_family = jupyter_dict.get('zope-family', '') -%}
{% set monitor_base_url_list = [] -%}
{% set monitor_base_url_dict = {} -%}
[request-common]
<= request-common-base
config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }}
......@@ -26,7 +26,7 @@ return = {{ ' '.join(ret) }}
{% do publish_dict.__setitem__(name ~ '-' ~ ret, '${' ~ section ~ ':connection-' ~ ret ~ '}') %}
{% endif -%}
{% if ret == "monitor-base-url" -%}
{% do monitor_base_url_list.append('${' ~ section ~ ':connection-' ~ ret ~ '}') -%}
{% do monitor_base_url_dict.__setitem__(section, '${' ~ section ~ ':connection-' ~ ret ~ '}') -%}
{% endif -%}
{% endfor -%}
{{ root_common.sla(name) }}
......@@ -182,7 +182,7 @@ software-type = zope
[{{ section_name }}]
<= request-zope-base
name = {{ partition_name }}
{% do monitor_base_url_list.append('${' ~ section_name ~ ':connection-monitor-base-url}') -%}
{% do monitor_base_url_dict.__setitem__(section_name, '${' ~ section_name ~ ':connection-monitor-base-url}') -%}
{{ root_common.sla(partition_name) }}
config-name = {{ dumps(custom_name) }}
config-instance-count = {{ dumps(zope_parameter_dict.get('instance-count', 1)) }}
......@@ -247,7 +247,7 @@ return =
{{ family }}
{{ family }}-v6
{% endfor -%}
{% do monitor_base_url_list.append('${' ~ 'request-balancer' ~ ':connection-monitor-base-url}') -%}
{% do monitor_base_url_dict.__setitem__('request-balancer', '${' ~ 'request-balancer' ~ ':connection-monitor-base-url}') -%}
config-zope-family-dict = {{ dumps(zope_family_parameter_dict) }}
config-tcpv4-port = {{ dumps(balancer_dict.get('tcpv4-port', 2150)) }}
......@@ -283,6 +283,7 @@ return = site_url
{% endif -%}{# if zope_partition_dict -#}
[publish]
<= monitor-publish
recipe = slapos.cookbook:publish.serialised
-extends = publish-early
{% if 'neo' in storage_dict -%}
......@@ -300,35 +301,27 @@ hosts-dict = {{ '${' ~ zope_address_list_id_dict.keys()[0] ~ ':connection-hosts-
{{ name }} = {{ value }}
{% endfor -%}
[buildout]
extends = {{ monitor_template }}
parts +=
monitor-base
[monitor-instance-parameter]
monitor-httpd-port = 8386
[monitor-passwd]
recipe = slapos.cookbook:generate.password
bytes = 8
storage_path = ${monitor-directory:etc}/monitor-htpasswd
{{ root_common.common_section() }}
[buildout]
extends =
{{ template_monitor }}
extends = {{ template_monitor }}
parts +=
monitor-base
[publish-connection-information]
<= monitor-publish
[monitor-conf-parameters]
monitor-title = ERP5 monitor
password = ${monitor-passwd:passwd}
monitor-url-list =
{% for url in monitor_base_url_list -%}
{{ ' ' ~ url }}
{% endfor %}
[monitor-base-url-dict]
{% for key, value in monitor_base_url_dict.items() -%}
{{ key }} = {{ value }}
{% endfor %}
......@@ -72,7 +72,7 @@ md5sum = 1695c9a06a2b11ccfe893d7a224e489d
[monitor-conf]
<= monitor-template-base
filename = monitor.conf.in
md5sum = c8f024d741c6494d7c9ba01601d0b917
md5sum = fc65084dd1c2fe2487b58a003b576f61
[monitor-instance-info]
<= monitor-template-base
......
......@@ -15,4 +15,4 @@
# not need these here).
[monitor2-template]
filename = instance-monitor.cfg.jinja2.in
md5sum = c963c43189a9b50e48ba27f2dd4e7b02
md5sum = d92f95b3e913bb10c9fd6262acdac589
......@@ -122,12 +122,16 @@ command =
echo "20" > ${:file}
fi
[monitor-base-url-dict]
# place holder to be used to collect erp5 monitor urls
[monitor-conf]
recipe = slapos.recipe.template:jinja2
template = {{ monitor_conf_template }}
rendered = ${directory:etc}/${:filename}
filename = monitor.conf
context = section parameter_dict monitor-conf-parameters
section monitor_base_urls monitor-base-url-dict
[instance-info-parameters]
name = ${monitor-instance-parameter:monitor-title}
......
[monitor]
{% for key, value in parameter_dict.items() -%}
{% if key == "monitor-url-list" and monitor_base_urls is defined -%}
{{ key }} =
{% for key, value in monitor_base_urls.items() -%}
{{ ' ' ~ value }}
{% endfor -%}
{% else -%}
{{ key }} = {{ value.strip().replace("\n", "\n ") }}
{% endfor -%}
\ No newline at end of file
{% endif -%}
{% endfor -%}
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