Commit 28be92cc authored by Łukasz Nowak's avatar Łukasz Nowak

monitor: Indent and annotate profiles

parent d095be0c
...@@ -26,11 +26,11 @@ md5sum = 2eb5596544d9c341acf653d4f7ce2680 ...@@ -26,11 +26,11 @@ md5sum = 2eb5596544d9c341acf653d4f7ce2680
[template-monitor-edgetest] [template-monitor-edgetest]
_update_hash_filename_ = instance-monitor-edgetest.cfg.jinja2 _update_hash_filename_ = instance-monitor-edgetest.cfg.jinja2
md5sum = a57106ee88ff3295b9ffce84105da79b md5sum = 7f257f581e1e0fdec0dcfedd5ea6ddfd
[template-monitor-edgebot] [template-monitor-edgebot]
_update_hash_filename_ = instance-monitor-edgebot.cfg.jinja2 _update_hash_filename_ = instance-monitor-edgebot.cfg.jinja2
md5sum = 92a064916843a92d6c756804cee70248 md5sum = e4bb096d12b2b82d1f1b743247f5500d
[network-bench-cfg] [network-bench-cfg]
filename = network_bench.cfg.in filename = network_bench.cfg.in
......
...@@ -10,22 +10,22 @@ ...@@ -10,22 +10,22 @@
{%- if extra_slave_instance_list %} {%- if extra_slave_instance_list %}
{#- Create slaves to process with setting up defaults #} {#- Create slaves to process with setting up defaults #}
{%- for slave in json_module.loads(extra_slave_instance_list) | sort(attribute='slave_title') %} {%- for slave in json_module.loads(extra_slave_instance_list) | sort(attribute='slave_title') %}
{%- if '_' in slave %} {%- if '_' in slave %}
{%- do slave.update(json_module.loads(slave.pop('_'))) %} {%- do slave.update(json_module.loads(slave.pop('_'))) %}
{%- do slave.setdefault('check-status-code', 200) %} {%- do slave.setdefault('check-status-code', 200) %}
{%- do slave.setdefault('check-http-header-dict', {}) %} {%- do slave.setdefault('check-http-header-dict', {}) %}
{%- do slave.setdefault('check-certificate-expiration-days', 15) %} {%- do slave.setdefault('check-certificate-expiration-days', 15) %}
{%- do slave.setdefault('failure-amount', 2) %} {%- do slave.setdefault('failure-amount', 2) %}
{%- do slave.setdefault('check-maximum-elapsed-time', 2) %} {%- do slave.setdefault('check-maximum-elapsed-time', 2) %}
{%- do slave.setdefault('check-frontend-ip', CONFIGURATION['check-frontend-ip']) %} {%- do slave.setdefault('check-frontend-ip', CONFIGURATION['check-frontend-ip']) %}
{%- if 'url' in slave %} {%- if 'url' in slave %}
{%- set class = slave['check-maximum-elapsed-time'] %} {%- set class = slave['check-maximum-elapsed-time'] %}
{%- if class not in slave_instance_dict %} {%- if class not in slave_instance_dict %}
{%- do slave_instance_dict.__setitem__(class, []) %} {%- do slave_instance_dict.__setitem__(class, []) %}
{%- endif %}
{%- do slave_instance_dict[class].append(slave) %}
{%- endif %}
{%- endif %} {%- endif %}
{%- do slave_instance_dict[class].append(slave) %}
{%- endif %}
{%- endif %}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}
{%- set part_list = [] %} {%- set part_list = [] %}
...@@ -101,9 +101,9 @@ cron-entries = ${directory:etc}/cron.d ...@@ -101,9 +101,9 @@ cron-entries = ${directory:etc}/cron.d
name = surykatka-status-{{ class }} name = surykatka-status-{{ class }}
frequency = */2 * * * * frequency = */2 * * * *
command = ${surykatka-status-json-{{ class }}:rendered} command = ${surykatka-status-json-{{ class }}:rendered}
{%- do part_list.append('surykatka-%i'% (class,)) %} {%- do part_list.append('surykatka-%i'% (class,)) %}
{%- do part_list.append('surykatka-bot-promise-%i' % (class,)) %} {%- do part_list.append('surykatka-bot-promise-%i' % (class,)) %}
{%- do part_list.append('cron-entry-surykatka-status-%i' % (class,)) %} {%- do part_list.append('cron-entry-surykatka-status-%i' % (class,)) %}
{%- endfor %} {%- endfor %}
[buildout] [buildout]
...@@ -154,4 +154,4 @@ key = ${slap-connection:key-file} ...@@ -154,4 +154,4 @@ key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file} cert = ${slap-connection:cert-file}
[slap-parameter] [slap-parameter]
{%- endif %} {%- endif %} {#- if slap_software_type == software_type #}
...@@ -16,7 +16,7 @@ extensions = jinja2.ext.do ...@@ -16,7 +16,7 @@ extensions = jinja2.ext.do
extra-context = extra-context =
section slave_information slap-configuration section slave_information slap-configuration
{% set part_list = [] -%} {% set part_list = [] -%}
# Publish information for each slave # Publish information for each slave
{%- set edgebot_software_type = 'edgebot' %} {%- set edgebot_software_type = 'edgebot' %}
{%- set edgebot_quantity = slapparameter_dict.pop('edgebot-quantity', '1') | int %} {%- set edgebot_quantity = slapparameter_dict.pop('edgebot-quantity', '1') | int %}
...@@ -56,7 +56,7 @@ software-url = ${slap-connection:software-release-url} ...@@ -56,7 +56,7 @@ software-url = ${slap-connection:software-release-url}
software-type = {{edgebot_software_type}} software-type = {{edgebot_software_type}}
return = monitor-base-url return = monitor-base-url
{% for section, edgebot_request in request_dict.items() %} {% for section, edgebot_request in request_dict.items() %}
[{{section}}] [{{section}}]
<= replicate <= replicate
name = {{ edgebot_request.get('name') }} name = {{ edgebot_request.get('name') }}
...@@ -68,7 +68,7 @@ state = {{ edgebot_request.get('state') }} ...@@ -68,7 +68,7 @@ state = {{ edgebot_request.get('state') }}
{%- do slave_configuration_dict.__setitem__(slave_list_name, json_module.dumps(authorized_slave_list)) %} {%- do slave_configuration_dict.__setitem__(slave_list_name, json_module.dumps(authorized_slave_list)) %}
{%- for config_key, config_value in slave_configuration_dict.items() %} {%- for config_key, config_value in slave_configuration_dict.items() %}
config-{{ config_key }} = {{ dumps(config_value) }} config-{{ config_key }} = {{ dumps(config_value) }}
{% endfor -%} {% endfor -%}
{%- if edgebot_request.get('sla') %} {%- if edgebot_request.get('sla') %}
{%- for parameter, value in edgebot_request.get('sla').items() %} {%- for parameter, value in edgebot_request.get('sla').items() %}
sla-{{ parameter }} = {{ value }} sla-{{ parameter }} = {{ value }}
...@@ -76,8 +76,8 @@ sla-{{ parameter }} = {{ value }} ...@@ -76,8 +76,8 @@ sla-{{ parameter }} = {{ value }}
{%- else %} {%- else %}
# As no SLA was provided, by default it is requested on the same computer # As no SLA was provided, by default it is requested on the same computer
sla-computer_guid = ${slap-connection:computer-id} sla-computer_guid = ${slap-connection:computer-id}
{% endif %} {% endif %}
{%- do monitor_base_url_dict.__setitem__(section, '${' ~ section ~ ':connection-monitor-base-url}') -%} {%- do monitor_base_url_dict.__setitem__(section, '${' ~ section ~ ':connection-monitor-base-url}') -%}
{%- endfor %} {%- endfor %}
{%- set directory_list = [] -%} {%- set directory_list = [] -%}
{%- for slave_instance in slave_instance_list -%} {%- for slave_instance in slave_instance_list -%}
...@@ -86,22 +86,22 @@ sla-computer_guid = ${slap-connection:computer-id} ...@@ -86,22 +86,22 @@ sla-computer_guid = ${slap-connection:computer-id}
[{{ publish_section_title }}] [{{ publish_section_title }}]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
-slave-reference = {{ slave_instance.get('slave_reference') }} -slave-reference = {{ slave_instance.get('slave_reference') }}
{% endfor %} {% endfor %}
[monitor-conf-parameters] [monitor-conf-parameters]
monitor-title = Monitor monitor-title = Monitor
password = ${monitor-htpasswd:passwd} password = ${monitor-htpasswd:passwd}
[monitor-base-url-dict] [monitor-base-url-dict]
{% for key, value in monitor_base_url_dict.items() -%} {% for key, value in monitor_base_url_dict.items() -%}
{{ key }} = {{ value }} {{ key }} = {{ value }}
{% endfor %} {% endfor %}
[buildout] [buildout]
extends = {{ instance_base_monitor }} extends = {{ instance_base_monitor }}
parts += parts +=
slave-test-configuration slave-test-configuration
{% for part in part_list %} {% for part in part_list %}
{{ ' %s' % part }} {{ ' %s' % part }}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %} {#- if slap_software_type == software_type #}
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