Commit 1f3f40b3 authored by Hardik Juneja's avatar Hardik Juneja

stack: Make monitor apache optional using a slap parameter

parent 823ba86d
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
# not need these here). # not need these here).
[template] [template]
filename = instance.cfg filename = instance.cfg
md5sum = 713db528880282d568278f09458d2aab md5sum = 73c7bd7dec7f874e8423d0ff4eba9427
[template-runner] [template-runner]
filename = instance-runner.cfg filename = instance-runner.cfg
md5sum = 8f49df215a1596efcec94e2cca009711 md5sum = c531ca046e137459d6cccb261eb7e540
[template-runner-import-script] [template-runner-import-script]
filename = template/runner-import.sh.jinja2 filename = template/runner-import.sh.jinja2
......
...@@ -41,7 +41,7 @@ parts = ...@@ -41,7 +41,7 @@ parts =
## Usability part ## Usability part
template-slapuser-script template-slapuser-script
extends = ${monitor2-template:rendered} extends = {{template_monitor}}
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
......
...@@ -30,6 +30,7 @@ context = key buildout buildout:bin-directory ...@@ -30,6 +30,7 @@ context = key buildout buildout:bin-directory
raw curl_executable_location ${curl:location}/bin/curl raw curl_executable_location ${curl:location}/bin/curl
raw dash_executable_location ${dash:location}/bin/dash raw dash_executable_location ${dash:location}/bin/dash
raw dcron_executable_location ${dcron:location}/sbin/crond raw dcron_executable_location ${dcron:location}/sbin/crond
raw template_monitor ${instance-monitor:rendered}
mode = 0644 mode = 0644
[instance-resilient] [instance-resilient]
...@@ -78,6 +79,13 @@ context = ...@@ -78,6 +79,13 @@ context =
raw pbsready_import_template_path ${pbsready-import:output} raw pbsready_import_template_path ${pbsready-import:output}
raw software_release_information_template ${template-resilient-software-release-information:destination}/${template-resilient-software-release-information:filename} raw software_release_information_template ${template-resilient-software-release-information:destination}/${template-resilient-software-release-information:filename}
[instance-monitor]
recipe = slapos.recipe.template:jinja2
template = $monitor2-template:output
rendered = ${buildout:directory}/template-monitor.cfg
extensions = jinja2.ext.do
mode = 0644
[slap-configuration] [slap-configuration]
recipe = slapos.cookbook:slapconfiguration recipe = slapos.cookbook:slapconfiguration
computer = $${slap-connection:computer-id} computer = $${slap-connection:computer-id}
......
...@@ -301,7 +301,7 @@ context = ...@@ -301,7 +301,7 @@ context =
key template_kumofs template-kumofs:target key template_kumofs template-kumofs:target
key template_mariadb template-mariadb:target key template_mariadb template-mariadb:target
key template_mariadb_initial_setup template-mariadb-initial-setup:target key template_mariadb_initial_setup template-mariadb-initial-setup:target
key template_monitor monitor2-template:rendered key template_monitor monitor2-template:output
key template_my_cnf template-my-cnf:target key template_my_cnf template-my-cnf:target
key template_postfix template-postfix:target key template_postfix template-postfix:target
key template_postfix_aliases template-postfix-aliases:target key template_postfix_aliases template-postfix-aliases:target
......
...@@ -23,15 +23,15 @@ md5sum = dc974bd74cf967ae6250d81322629c44 ...@@ -23,15 +23,15 @@ md5sum = dc974bd74cf967ae6250d81322629c44
[template-mariadb] [template-mariadb]
filename = instance-mariadb.cfg.in filename = instance-mariadb.cfg.in
md5sum = 2126e64bc70893500dc24c29770e84c8 md5sum = 37bbcfb4bb2fa96c14821d2e36e1386a
[template-kumofs] [template-kumofs]
filename = instance-kumofs.cfg.in filename = instance-kumofs.cfg.in
md5sum = 091d3c3feb2d543d176b0fadb11c07dc md5sum = 0d9e3cec640e863aa860ccb6941fb8cc
[template-cloudooo] [template-cloudooo]
filename = instance-cloudoo.cfg.in filename = instance-cloudoo.cfg.in
md5sum = 76f9e8c8cdc352081e34539d8fc17026 md5sum = f12bbf6c9aca8eb1accf6c95df165716
[template-zope-conf] [template-zope-conf]
filename = zope.conf.in filename = zope.conf.in
...@@ -75,7 +75,7 @@ md5sum = 0969fbb25b05c02ef3c2d437b2f4e1a0 ...@@ -75,7 +75,7 @@ md5sum = 0969fbb25b05c02ef3c2d437b2f4e1a0
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = e364ea67bfe786b6b6ebd6c4f0cd628a md5sum = afc12c2d14876705b47cd219a65dcc31
[monitor-template-dummy] [monitor-template-dummy]
filename = dummy.cfg filename = dummy.cfg
...@@ -87,11 +87,11 @@ md5sum = 03983ea97d53e40bf3caf3d6744e1137 ...@@ -87,11 +87,11 @@ md5sum = 03983ea97d53e40bf3caf3d6744e1137
[template-zeo] [template-zeo]
filename = instance-zeo.cfg.in filename = instance-zeo.cfg.in
md5sum = d1f33d406d528ae27d973e2dd0efb1ba md5sum = 0da85c80c47b5f05a2cbd3b0bf0b111d
[template-zope] [template-zope]
filename = instance-zope.cfg.in filename = instance-zope.cfg.in
md5sum = a2377d5c53fd2a441ea713b428e4844b md5sum =
[template-balancer] [template-balancer]
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
......
{% set bin_directory = parameter_dict['buildout-bin-directory'] -%} {% set bin_directory = parameter_dict['buildout-bin-directory'] -%}
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%} {% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
{% set monitor_dict = slapparameter_dict.get('monitor', {}) %}
[buildout] [buildout]
extends = extends =
{{ parameter_dict['template-monitor'] }} {{ parameter_dict['template-monitor'] }}
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
{% set jupyter_dict = slapparameter_dict.get('jupyter', {}) -%} {% set jupyter_dict = slapparameter_dict.get('jupyter', {}) -%}
{% set has_jupyter = jupyter_dict.get('enable', jupyter_enable_default.lower() in ('true', 'yes')) -%} {% set has_jupyter = jupyter_dict.get('enable', jupyter_enable_default.lower() in ('true', 'yes')) -%}
{% set jupyter_zope_family = jupyter_dict.get('zope-family', '') -%} {% set jupyter_zope_family = jupyter_dict.get('zope-family', '') -%}
{% set monitor_dict = slapparameter_dict.get('monitor', {}) %}
{% set monitor_base_url_dict = {} -%} {% set monitor_base_url_dict = {} -%}
{% set caucase_url = slapparameter_dict.get('caucase', {}).pop('url', '') -%} {% set caucase_url = slapparameter_dict.get('caucase', {}).pop('url', '') -%}
{% set crl_update_period = slapparameter_dict.get('caucase', {}).pop('crl-update-periodicity', 'daily') -%} {% set crl_update_period = slapparameter_dict.get('caucase', {}).pop('crl-update-periodicity', 'daily') -%}
......
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%} {% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
{% set monitor_dict = slapparameter_dict.get('monitor', {}) %}
[buildout] [buildout]
extends = extends =
{{ logrotate_cfg }} {{ logrotate_cfg }}
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
{% set ip = (ipv4_set | list)[0] -%} {% set ip = (ipv4_set | list)[0] -%}
{% endif -%} {% endif -%}
{% set dash = parameter_dict['dash-location'] ~ '/bin/dash' %} {% set dash = parameter_dict['dash-location'] ~ '/bin/dash' %}
{% set monitor_dict = slapparameter_dict.get('monitor', {}) %}
[{{ section('publish') }}] [{{ section('publish') }}]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
{% set default_zodb_path = buildout_directory ~ '/srv/zodb' -%} {% set default_zodb_path = buildout_directory ~ '/srv/zodb' -%}
{% set default_backup_path = buildout_directory ~ '/srv/backup/zodb' -%} {% set default_backup_path = buildout_directory ~ '/srv/backup/zodb' -%}
{% set bin_directory = parameter_dict['buildout-bin-directory'] -%} {% set bin_directory = parameter_dict['buildout-bin-directory'] -%}
{% set monitor_dict = slapparameter_dict.get('monitor', {}) %}
[zeo-base] [zeo-base]
recipe = slapos.cookbook:zeo recipe = slapos.cookbook:zeo
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
{% set longrequest_logger_base_path = buildout_directory ~ '/var/log/longrequest_logger_' -%} {% set longrequest_logger_base_path = buildout_directory ~ '/var/log/longrequest_logger_' -%}
{% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%} {% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%}
{% set bin_directory = parameter_dict['buildout-bin-directory'] -%} {% set bin_directory = parameter_dict['buildout-bin-directory'] -%}
{% set monitor_dict = slapparameter_dict.get('monitor', {}) %}
{# {#
XXX: This template only supports exactly one IPv4 and one IPv6 per XXX: This template only supports exactly one IPv4 and one IPv6 per
partition. No more (undefined result), no less (IndexError). partition. No more (undefined result), no less (IndexError).
......
...@@ -43,7 +43,7 @@ fonts = {{ fonts_location }} ...@@ -43,7 +43,7 @@ fonts = {{ fonts_location }}
buildout-bin-directory = {{ buildout_bin_directory }} buildout-bin-directory = {{ buildout_bin_directory }}
6tunnel = {{ sixtunnel_location }} 6tunnel = {{ sixtunnel_location }}
dash = {{ dash_location }} dash = {{ dash_location }}
template-monitor = {{ dumps(template_monitor) }} template-monitor = ${instance-monitor:rendered}
[dynamic-template-cloudooo] [dynamic-template-cloudooo]
<= jinja2-template-base <= jinja2-template-base
...@@ -74,7 +74,7 @@ extra-context = ...@@ -74,7 +74,7 @@ extra-context =
[dynamic-template-erp5-parameters] [dynamic-template-erp5-parameters]
jupyter-enable-default = {{ jupyter_enable_default }} jupyter-enable-default = {{ jupyter_enable_default }}
local-bt5-repository = {{ local_bt5_repository }} local-bt5-repository = {{ local_bt5_repository }}
template-monitor = {{ dumps(template_monitor) }} template-monitor = ${instance-monitor:rendered}
[dynamic-template-erp5] [dynamic-template-erp5]
<= jinja2-template-base <= jinja2-template-base
...@@ -103,7 +103,7 @@ curl-location = {{ curl_location }} ...@@ -103,7 +103,7 @@ curl-location = {{ curl_location }}
dash = {{ dash_location }} dash = {{ dash_location }}
template-haproxy-cfg = {{ template_haproxy_cfg }} template-haproxy-cfg = {{ template_haproxy_cfg }}
template-apache-conf = {{ template_apache_conf }} template-apache-conf = {{ template_apache_conf }}
template-monitor = {{ dumps(template_monitor) }} template-monitor = ${instance-monitor:rendered}
[dynamic-template-balancer] [dynamic-template-balancer]
<= jinja2-template-base <= jinja2-template-base
...@@ -115,7 +115,7 @@ extra-context = ...@@ -115,7 +115,7 @@ extra-context =
[dynamic-template-zeo-parameters] [dynamic-template-zeo-parameters]
buildout-bin-directory = {{ buildout_bin_directory }} buildout-bin-directory = {{ buildout_bin_directory }}
template-monitor = {{ dumps(template_monitor) }} template-monitor = ${instance-monitor:rendered}
[dynamic-template-zeo] [dynamic-template-zeo]
<= jinja2-template-base <= jinja2-template-base
...@@ -138,7 +138,7 @@ jsl = {{ jsl_location }} ...@@ -138,7 +138,7 @@ jsl = {{ jsl_location }}
link-binary = {{ dumps(zope_link_binary) }} link-binary = {{ dumps(zope_link_binary) }}
userhosts = {{ userhosts_location }} userhosts = {{ userhosts_location }}
site-zcml = {{ site_zcml }} site-zcml = {{ site_zcml }}
template-monitor = {{ dumps(template_monitor) }} template-monitor = ${instance-monitor:rendered}
extra-path-list = {{ dumps(extra_path_list) }} extra-path-list = {{ dumps(extra_path_list) }}
matplotlibrc = {{ matplotlibrc_location }} matplotlibrc = {{ matplotlibrc_location }}
...@@ -159,7 +159,7 @@ dcron-location = {{ dcron_location }} ...@@ -159,7 +159,7 @@ dcron-location = {{ dcron_location }}
gzip-location = {{ gzip_location }} gzip-location = {{ gzip_location }}
kumo-location = {{ kumo_location }} kumo-location = {{ kumo_location }}
logrotate-location = {{ logrotate_location }} logrotate-location = {{ logrotate_location }}
template-monitor = {{ dumps(template_monitor) }} template-monitor = ${instance-monitor:rendered}
[dynamic-template-kumofs] [dynamic-template-kumofs]
<= jinja2-template-base <= jinja2-template-base
...@@ -181,7 +181,7 @@ bin-directory = {{ bin_directory }} ...@@ -181,7 +181,7 @@ bin-directory = {{ bin_directory }}
mariadb-resiliency-after-import-script = {{ mariadb_resiliency_after_import_script }} mariadb-resiliency-after-import-script = {{ mariadb_resiliency_after_import_script }}
mariadb-slow-query-report-script = {{ mariadb_slow_query_report_script }} mariadb-slow-query-report-script = {{ mariadb_slow_query_report_script }}
percona-tools-location = {{ percona_toolkit_location }} percona-tools-location = {{ percona_toolkit_location }}
template-monitor = {{ template_monitor }} template-monitor = ${instance-monitor:rendered}
[dynamic-template-mariadb] [dynamic-template-mariadb]
<= jinja2-template-base <= jinja2-template-base
...@@ -208,6 +208,14 @@ extra-context = ...@@ -208,6 +208,14 @@ extra-context =
[dynamic-template-jupyter] [dynamic-template-jupyter]
rendered = {{ template_jupyter_cfg }} rendered = {{ template_jupyter_cfg }}
[instance-monitor]
recipe = slapos.recipe.template:jinja2
template = {{ dumps(template_monitor) }}
rendered = ${buildout:directory}/template-monitor.cfg
extensions = jinja2.ext.do
context = key buildout buildout:bin-directory
mode = 0644
[switch-softwaretype] [switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype recipe = slapos.cookbook:switch-softwaretype
override = {{ dumps(override_switch_softwaretype |default) }} override = {{ dumps(override_switch_softwaretype |default) }}
......
...@@ -96,10 +96,16 @@ rendered = ${monitor2-template:rendered} ...@@ -96,10 +96,16 @@ rendered = ${monitor2-template:rendered}
output = ${monitor2-template:rendered} output = ${monitor2-template:rendered}
[monitor2-template] [monitor2-template]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template
filename = template-monitor.cfg url = ${:_profile_base_location_}/${:filename}
filename = instance-monitor.cfg
mode = 0644
output = ${buildout:directory}/template-monitor.cfg
[remove-section]
#recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance-monitor.cfg.jinja2.in template = ${:_profile_base_location_}/instance-monitor.cfg.jinja2.in
rendered = ${buildout:directory}/template-monitor.cfg
context = context =
key apache_location apache:location key apache_location apache:location
key gzip_location gzip:location key gzip_location gzip:location
......
...@@ -14,5 +14,5 @@ ...@@ -14,5 +14,5 @@
# section inheritance (< = ...) are NOT supported (but you should really # section inheritance (< = ...) are NOT supported (but you should really
# not need these here). # not need these here).
[monitor2-template] [monitor2-template]
filename = instance-monitor.cfg.jinja2.in filename = instance-monitor.cfg
md5sum = 5027f0b1abcc28ce3817cd70fb667a3b md5sum = 3d2093fa58da21266d011a752bc2e91f
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