Commit 460909b7 authored by Hardik Juneja's avatar Hardik Juneja

abc

parent 17fd0fbf
...@@ -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}
......
...@@ -296,7 +296,7 @@ context = ...@@ -296,7 +296,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 = 1894a05674a7f670692bb2e12ff44d9c md5sum = 7a51373f53ce075c58a7793abb9d1db5
[template-kumofs] [template-kumofs]
filename = instance-kumofs.cfg.in filename = instance-kumofs.cfg.in
md5sum = 5ac90bdfd30156822b9702a8b73a4d8e md5sum = a6dcb93c8d2e34ecde07a3f79280ca51
[template-cloudooo] [template-cloudooo]
filename = instance-cloudoo.cfg.in filename = instance-cloudoo.cfg.in
md5sum = 53a669a7fd42c14596ad7d3a79dfe760 md5sum = d19c02f05b71fe23db248b5cbaf0d4ce
[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 = 09862389b2bf3da3f9387a6424329da9 md5sum = 1df9a589da262c3de6df1a73d5bb0a37
[monitor-template-dummy] [monitor-template-dummy]
filename = dummy.cfg filename = dummy.cfg
...@@ -83,19 +83,19 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e ...@@ -83,19 +83,19 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e
[template-erp5] [template-erp5]
filename = instance-erp5.cfg.in filename = instance-erp5.cfg.in
md5sum = b8cb62bbbcbd7d85258aa63b14be9a20 md5sum = 3f5eac64afbeba450e64888cbfed29ee
[template-zeo] [template-zeo]
filename = instance-zeo.cfg.in filename = instance-zeo.cfg.in
md5sum = d04d0f67e399543004f5f363ff448052 md5sum = 165ba64a6db5219e24d781e5019401b9
[template-zope] [template-zope]
filename = instance-zope.cfg.in filename = instance-zope.cfg.in
md5sum = f08e4750f66a3aa27c9379ae278bdd8c md5sum = 8a507ce5f4cddfa0baf3b7561dc14539
[template-balancer] [template-balancer]
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
md5sum = 865efaf767a747d263edad9108a76191 md5sum = a3ad32c46bb56076895441edbd66018d
[template-haproxy-cfg] [template-haproxy-cfg]
filename = haproxy.cfg.in filename = haproxy.cfg.in
......
...@@ -230,9 +230,6 @@ monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }} ...@@ -230,9 +230,6 @@ monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ next_port() }} monitor-httpd-port = {{ next_port() }}
monitor-title = Balancer monitor monitor-title = Balancer monitor
password = {{ slapparameter_dict['monitor-passwd'] }} password = {{ slapparameter_dict['monitor-passwd'] }}
{% if slapparameter_dict.get('monitor-disable-apache') -%}
monitor-base-url =
{% endif -%}
instance-configuration = instance-configuration =
file apachedex-default ${apachedex-parameters:default} file apachedex-default ${apachedex-parameters:default}
file apachedex-base-list ${apachedex-parameters:base-list} file apachedex-base-list ${apachedex-parameters:base-list}
......
...@@ -113,9 +113,6 @@ framebuffer = ${:srv}/framebuffer ...@@ -113,9 +113,6 @@ framebuffer = ${:srv}/framebuffer
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }} monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ tcpv4_port + 2 }} monitor-httpd-port = {{ tcpv4_port + 2 }}
monitor-title = Cloudooo monitor monitor-title = Cloudooo monitor
{% if slapparameter_dict.get('monitor-disable-apache') -%}
monitor-base-url =
{% endif -%}
password = {{ slapparameter_dict['monitor-passwd'] }} password = {{ slapparameter_dict['monitor-passwd'] }}
[binary-link] [binary-link]
......
...@@ -39,10 +39,10 @@ config-{{ k }} = {{ '${' ~ v ~ '}' }} ...@@ -39,10 +39,10 @@ config-{{ k }} = {{ '${' ~ v ~ '}' }}
{% endfor -%} {% endfor -%}
{% endmacro -%} {% endmacro -%}
{{ request('memcached-persistent', 'kumofs', 'kumofs', {'tcpv4-port': 2000, 'monitor-disable-apache': monitor_dict.get('disable-apache')}, {'url': True, 'monitor-base-url': False}, key_config={'monitor-passwd': 'monitor-htpasswd:passwd'}) }} {{ request('memcached-persistent', 'kumofs', 'kumofs', {'tcpv4-port': 2000}, {'url': True, 'monitor-base-url': False}, key_config={'monitor-passwd': 'monitor-htpasswd:passwd'}) }}
{{ request('memcached-volatile', 'kumofs', 'memcached', {'tcpv4-port': 2010, 'ram-storage-size': 64, 'monitor-disable-apache': monitor_dict.get('disable-apache')}, {'url': True, 'monitor-base-url': False}, key_config={'monitor-passwd': 'monitor-htpasswd:passwd'}) }} {{ request('memcached-volatile', 'kumofs', 'memcached', {'tcpv4-port': 2010, 'ram-storage-size': 64}, {'url': True, 'monitor-base-url': False}, key_config={'monitor-passwd': 'monitor-htpasswd:passwd'}) }}
{{ request('cloudooo', 'cloudooo', 'cloudooo', {'tcpv4-port': 2020, 'monitor-disable-apache': monitor_dict.get('disable-apache')}, {'url': True, 'monitor-base-url': False}, key_config={'monitor-passwd': 'monitor-htpasswd:passwd'}) }} {{ request('cloudooo', 'cloudooo', 'cloudooo', {'tcpv4-port': 2020}, {'url': True, 'monitor-base-url': False}, key_config={'monitor-passwd': 'monitor-htpasswd:passwd'}) }}
{{ request('mariadb', 'mariadb', 'mariadb', {'tcpv4-port': 2099, 'monitor-disable-apache': monitor_dict.get('disable-apache')}, {'database-list': True, 'test-database-list': True, 'monitor-base-url': False}, key_config={'monitor-passwd': 'monitor-htpasswd:passwd'}) }} {{ request('mariadb', 'mariadb', 'mariadb', {'tcpv4-port': 2099}, {'database-list': True, 'test-database-list': True, 'monitor-base-url': False}, key_config={'monitor-passwd': 'monitor-htpasswd:passwd'}) }}
{% if has_posftix -%} {% if has_posftix -%}
{{ request('smtp', 'postfix', 'smtp', {'tcpv4-port': 2025, 'smtpd-sasl-user': 'erp5@nowhere'}, key_config={'smtpd-sasl-password': 'publish-early:smtpd-sasl-password'}) }} {{ request('smtp', 'postfix', 'smtp', {'tcpv4-port': 2025, 'smtpd-sasl-user': 'erp5@nowhere'}, key_config={'smtpd-sasl-password': 'publish-early:smtpd-sasl-password'}) }}
{%- else %} {%- else %}
...@@ -79,7 +79,7 @@ connection-url = smtp://127.0.0.2:0/ ...@@ -79,7 +79,7 @@ connection-url = smtp://127.0.0.2:0/
{% else -%} {% else -%}
{{ assert(server_type == 'zeo', server_type) -}} {{ assert(server_type == 'zeo', server_type) -}}
{# BBB: for compatibility, keep 'zodb' as partition_reference for ZEO -#} {# BBB: for compatibility, keep 'zodb' as partition_reference for ZEO -#}
{{ request('zodb', 'zodb-' ~ server_type, 'zodb-' ~ server_type, {'tcpv4-port': 2100, 'zodb-dict': server_dict, 'monitor-disable-apache': monitor_dict.get('disable-apache')}, dict.fromkeys(('storage-dict', 'tidstorage-ip', 'tidstorage-port', 'monitor-base-url')), key_config={'monitor-passwd': 'monitor-htpasswd:passwd'}) }} {{ request('zodb', 'zodb-' ~ server_type, 'zodb-' ~ server_type, {'tcpv4-port': 2100, 'zodb-dict': server_dict}, dict.fromkeys(('storage-dict', 'tidstorage-ip', 'tidstorage-port', 'monitor-base-url')), key_config={'monitor-passwd': 'monitor-htpasswd:passwd'}) }}
{% endif -%} {% endif -%}
{% endfor -%} {% endfor -%}
...@@ -147,7 +147,6 @@ config-inituser-login = {{ dumps(inituser_login) }} ...@@ -147,7 +147,6 @@ config-inituser-login = {{ dumps(inituser_login) }}
config-inituser-password = ${publish-early:inituser-password} config-inituser-password = ${publish-early:inituser-password}
config-kumofs-url = ${request-memcached-persistent:connection-url} config-kumofs-url = ${request-memcached-persistent:connection-url}
config-memcached-url = ${request-memcached-volatile:connection-url} config-memcached-url = ${request-memcached-volatile:connection-url}
config-monitor-disable-apache = monitor_dict.get('disable-apache')
config-monitor-passwd = ${monitor-htpasswd:passwd} config-monitor-passwd = ${monitor-htpasswd:passwd}
config-mysql-test-url-list = ${request-mariadb:connection-test-database-list} config-mysql-test-url-list = ${request-mariadb:connection-test-database-list}
config-mysql-url-list = ${request-mariadb:connection-database-list} config-mysql-url-list = ${request-mariadb:connection-database-list}
...@@ -260,7 +259,6 @@ config-{{ name }} = {{ ' ${' ~ zope_section_id ~ ':connection-zope-address-list} ...@@ -260,7 +259,6 @@ config-{{ name }} = {{ ' ${' ~ zope_section_id ~ ':connection-zope-address-list}
config-haproxy-server-check-path = {{ dumps(balancer_dict.get('haproxy-server-check-path', '/') % {'site-id': site_id}) }} config-haproxy-server-check-path = {{ dumps(balancer_dict.get('haproxy-server-check-path', '/') % {'site-id': site_id}) }}
config-backend-path = {{ dumps(balancer_dict.get('apache-backend-path', '/') % {'site-id': site_id}) }} config-backend-path = {{ dumps(balancer_dict.get('apache-backend-path', '/') % {'site-id': site_id}) }}
config-ssl = {{ dumps(balancer_dict.get('ssl', {})) }} config-ssl = {{ dumps(balancer_dict.get('ssl', {})) }}
config-monitor-disable-apache = monitor_dict.get('disable-apache')
config-monitor-passwd = ${monitor-htpasswd:passwd} config-monitor-passwd = ${monitor-htpasswd:passwd}
...@@ -318,9 +316,6 @@ parts += ...@@ -318,9 +316,6 @@ parts +=
[monitor-conf-parameters] [monitor-conf-parameters]
monitor-title = ERP5 monitor monitor-title = ERP5 monitor
password = ${monitor-htpasswd:passwd} password = ${monitor-htpasswd:passwd}
{% if monitor_dict.get('disable-apache') == True -%}
monitor-base-url =
{% endif -%}
[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() -%}
......
...@@ -114,7 +114,4 @@ port = ${kumofs-instance:manager-port} ...@@ -114,7 +114,4 @@ port = ${kumofs-instance:manager-port}
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }} monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ tcpv4_port + 4 }} monitor-httpd-port = {{ tcpv4_port + 4 }}
monitor-title = Kumofs monitor monitor-title = Kumofs monitor
{% if slapparameter_dict.get('monitor-disable-apache') -%}
monitor-base-url =
{% endif -%}
password = {{ slapparameter_dict['monitor-passwd'] }} password = {{ slapparameter_dict['monitor-passwd'] }}
...@@ -303,9 +303,6 @@ parameters-extra = true ...@@ -303,9 +303,6 @@ parameters-extra = true
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }} monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ port + 1 }} monitor-httpd-port = {{ port + 1 }}
monitor-title = Mariadb monitor monitor-title = Mariadb monitor
{% if slapparameter_dict.get('monitor-disable-apache') -%}
monitor-base-url =
{% endif -%}
password = {{ slapparameter_dict['monitor-passwd'] }} password = {{ slapparameter_dict['monitor-passwd'] }}
[buildout] [buildout]
......
...@@ -187,9 +187,6 @@ tidstorage = {{ tidstorage_repozo_path }} ...@@ -187,9 +187,6 @@ tidstorage = {{ tidstorage_repozo_path }}
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }} monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ next_port() }} monitor-httpd-port = {{ next_port() }}
monitor-title = ZODB monitor monitor-title = ZODB monitor
{% if monitor_dict.get('disable-apache') == True -%}
monitor-base-url =
{% endif -%}
password = {{ slapparameter_dict['monitor-passwd'] }} password = {{ slapparameter_dict['monitor-passwd'] }}
[buildout] [buildout]
......
...@@ -396,9 +396,6 @@ bt5-repository-url = {{ dumps(slapparameter_dict['bt5-repository-url']) }} ...@@ -396,9 +396,6 @@ bt5-repository-url = {{ dumps(slapparameter_dict['bt5-repository-url']) }}
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }} monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ next_port() }} monitor-httpd-port = {{ next_port() }}
monitor-title = Zope monitor monitor-title = Zope monitor
{% if monitor_dict.get('disable-apache') == True -%}
monitor-base-url =
{% endif -%}
password = {{ slapparameter_dict['monitor-passwd'] }} password = {{ slapparameter_dict['monitor-passwd'] }}
[buildout] [buildout]
......
...@@ -41,7 +41,7 @@ fonts = {{ fonts_location }} ...@@ -41,7 +41,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
...@@ -72,7 +72,7 @@ extra-context = ...@@ -72,7 +72,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
...@@ -100,7 +100,7 @@ run-apachedex-location = {{ bin_directory }}/runApacheDex ...@@ -100,7 +100,7 @@ run-apachedex-location = {{ bin_directory }}/runApacheDex
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
...@@ -112,7 +112,7 @@ extra-context = ...@@ -112,7 +112,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
...@@ -135,7 +135,7 @@ jsl = {{ jsl_location }} ...@@ -135,7 +135,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 }}
...@@ -156,7 +156,7 @@ dcron-location = {{ dcron_location }} ...@@ -156,7 +156,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
...@@ -178,7 +178,7 @@ bin-directory = {{ bin_directory }} ...@@ -178,7 +178,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
...@@ -205,6 +205,14 @@ extra-context = ...@@ -205,6 +205,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 = 054cedcee5e3b82dca992c9ff45b85cd md5sum = 3d2093fa58da21266d011a752bc2e91f
[slap-configuration] [slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised recipe = slapos.cookbook:slapconfiguration.serialised
computer = ${slap-connection:computer-id} computer = $${slap-connection:computer-id}
partition = ${slap-connection:partition-id} partition = $${slap-connection:partition-id}
url = ${slap-connection:server-url} url = $${slap-connection:server-url}
key = ${slap-connection:key-file} key = $${slap-connection:key-file}
cert = ${slap-connection:cert-file} cert = $${slap-connection:cert-file}
# XXX Default values if doesn't exists # XXX Default values if doesn't exists
root-instance-title = UNKNOWN H-S root-instance-title = UNKNOWN H-S
...@@ -12,114 +12,114 @@ instance-title = UNKNOWN Instance ...@@ -12,114 +12,114 @@ instance-title = UNKNOWN Instance
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc etc = $${buildout:directory}/etc
bin = ${buildout:directory}/bin bin = $${buildout:directory}/bin
srv = ${buildout:directory}/srv srv = $${buildout:directory}/srv
var = ${buildout:directory}/var var = $${buildout:directory}/var
run = ${:var}/run run = $${:var}/run
log = ${:var}/log log = $${:var}/log
scripts = ${:etc}/run scripts = $${:etc}/run
services = ${:etc}/service services = $${:etc}/service
promises = ${:etc}/promise promises = $${:etc}/promise
monitor = ${:srv}/monitor monitor = $${:srv}/monitor
monitor-promise = ${:etc}/monitor-promise monitor-promise = $${:etc}/monitor-promise
monitor-report = ${:etc}/monitor-report monitor-report = $${:etc}/monitor-report
[monitor-directory] [monitor-directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
bin = ${directory:bin} bin = $${directory:bin}
etc = ${directory:etc} etc = $${directory:etc}
run = ${directory:monitor}/run run = $${directory:monitor}/run
#run = ${directory:scripts} #run = $${directory:scripts}
promises = ${directory:monitor-promise} promises = $${directory:monitor-promise}
reports = ${directory:monitor-report} reports = $${directory:monitor-report}
pids = ${directory:run}/monitor pids = $${directory:run}/monitor
cgi-bin = ${directory:monitor}/cgi-bin cgi-bin = $${directory:monitor}/cgi-bin
webdav = ${directory:monitor}/webdav webdav = $${directory:monitor}/webdav
public = ${directory:monitor}/public public = $${directory:monitor}/public
private = ${directory:monitor}/private private = $${directory:monitor}/private
services = ${directory:services} services = $${directory:services}
services-conf = ${directory:etc}/monitor.conf.d services-conf = $${directory:etc}/monitor.conf.d
log = ${directory:log}/monitor log = $${directory:log}/monitor
monitor-var = ${directory:var}/monitor monitor-var = $${directory:var}/monitor
[ca-directory] [ca-directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
root = ${directory:srv}/ssl root = $${directory:srv}/ssl
requests = ${:root}/requests requests = $${:root}/requests
private = ${:root}/private private = $${:root}/private
certs = ${:root}/certs certs = $${:root}/certs
newcerts = ${:root}/newcerts newcerts = $${:root}/newcerts
crl = ${:root}/crl crl = $${:root}/crl
[certificate-authority] [certificate-authority]
recipe = slapos.cookbook:certificate_authority recipe = slapos.cookbook:certificate_authority
openssl-binary = {{ openssl_executable_location }} openssl-binary = ${openssl:location}/bin/openssl
ca-dir = ${ca-directory:root} ca-dir = $${ca-directory:root}
requests-directory = ${ca-directory:requests} requests-directory = $${ca-directory:requests}
wrapper = ${monitor-directory:services}/certificate_authority wrapper = $${monitor-directory:services}/certificate_authority
ca-private = ${ca-directory:private} ca-private = $${ca-directory:private}
ca-certs = ${ca-directory:certs} ca-certs = $${ca-directory:certs}
ca-newcerts = ${ca-directory:newcerts} ca-newcerts = $${ca-directory:newcerts}
ca-crl = ${ca-directory:crl} ca-crl = $${ca-directory:crl}
[ca-monitor-httpd] [ca-monitor-httpd]
<= certificate-authority <= certificate-authority
recipe = slapos.cookbook:certificate_authority.request recipe = slapos.cookbook:certificate_authority.request
key-file = ${monitor-httpd-conf-parameter:key-file} key-file = $${monitor-httpd-conf-parameter:key-file}
cert-file = ${monitor-httpd-conf-parameter:cert-file} cert-file = $${monitor-httpd-conf-parameter:cert-file}
executable = ${monitor-httpd-wrapper:wrapper-path} executable = $${monitor-httpd-wrapper:wrapper-path}
wrapper = ${directory:services}/monitor-httpd wrapper = $${directory:services}/monitor-httpd
[monitor-conf-parameters] [monitor-conf-parameters]
title = ${monitor-instance-parameter:monitor-title} title = $${monitor-instance-parameter:monitor-title}
root-title = ${monitor-instance-parameter:root-instance-title} root-title = $${monitor-instance-parameter:root-instance-title}
public-folder = ${monitor-directory:public} public-folder = $${monitor-directory:public}
private-folder = ${monitor-directory:private} private-folder = $${monitor-directory:private}
webdav-folder = ${monitor-directory:webdav} webdav-folder = $${monitor-directory:webdav}
report-folder = ${monitor-directory:reports} report-folder = $${monitor-directory:reports}
base-url = ${monitor-instance-parameter:monitor-base-url} base-url = $${monitor-instance-parameter:monitor-base-url}
monitor-hal-json = ${monitor-directory:public}/monitor.hal.json monitor-hal-json = $${monitor-directory:public}/monitor.hal.json
service-pid-folder = ${monitor-directory:pids} service-pid-folder = $${monitor-directory:pids}
crond-folder = ${logrotate-directory:cron-entries} crond-folder = $${logrotate-directory:cron-entries}
logrotate-folder = ${logrotate-directory:logrotate-entries} logrotate-folder = $${logrotate-directory:logrotate-entries}
promise-runner = {{ monitor_runpromise }} promise-runner = ${buildout:directory}/bin/monitor.runpromise
promise-folder = ${directory:promises} promise-folder = $${directory:promises}
monitor-promise-folder = ${monitor-directory:promises} monitor-promise-folder = $${monitor-directory:promises}
promises-timeout-file = ${monitor-promise-timeout-file:file} promises-timeout-file = $${monitor-promise-timeout-file:file}
pid-file = ${monitor-directory:pids}/monitor-bootstrap.pid pid-file = $${monitor-directory:pids}/monitor-bootstrap.pid
public-path-list = public-path-list =
private-path-list = private-path-list =
${directory:log} $${directory:log}
# #
monitor-url-list = monitor-url-list =
${monitor-instance-parameter:monitor-url-list} $${monitor-instance-parameter:monitor-url-list}
parameter-file-path = ${monitor-instance-parameter:configuration-file-path} parameter-file-path = $${monitor-instance-parameter:configuration-file-path}
parameter-list = parameter-list =
raw monitor-user ${monitor-instance-parameter:username} raw monitor-user $${monitor-instance-parameter:username}
htpasswd monitor-password ${httpd-monitor-htpasswd:password-file} ${monitor-instance-parameter:username} ${httpd-monitor-htpasswd:htpasswd-path} htpasswd monitor-password $${httpd-monitor-htpasswd:password-file} $${monitor-instance-parameter:username} $${httpd-monitor-htpasswd:htpasswd-path}
file promise-timeout ${monitor-promise-timeout-file:file} file promise-timeout $${monitor-promise-timeout-file:file}
file min-free-disk-MB ${promise-check-free-disk-space:config-file} file min-free-disk-MB $${promise-check-free-disk-space:config-file}
${monitor-instance-parameter:instance-configuration} $${monitor-instance-parameter:instance-configuration}
# htpasswd entry: htpasswd key password-file username htpasswd-file # htpasswd entry: htpasswd key password-file username htpasswd-file
collector-db = ${monitor-instance-parameter:collector-db} collector-db = $${monitor-instance-parameter:collector-db}
collect-script = {{ monitor_collect }} collect-script = ${buildout:directory}/bin/monitor.collect
statistic-script = {{ monitor_statistic }} statistic-script = ${buildout:directory}/bin/monitor.statistic
python = {{ python_with_eggs }} python = ${buildout:directory}/bin/${extra-eggs:interpreter}
nice-cmd = ${xnice-bin:output} nice-cmd = $${xnice-bin:output}
promise-output-file = ${directory:monitor}/monitor-bootstrap-status promise-output-file = $${directory:monitor}/monitor-bootstrap-status
[monitor-promise-timeout-file] [monitor-promise-timeout-file]
recipe = plone.recipe.command recipe = plone.recipe.command
file = ${directory:etc}/promise_timeout file = $${directory:etc}/promise_timeout
command = command =
if [ ! -s "${:file}" ]; then if [ ! -s "$${:file}" ]; then
echo "20" > ${:file} echo "20" > $${:file}
fi fi
[monitor-base-url-dict] [monitor-base-url-dict]
...@@ -127,81 +127,81 @@ command = ...@@ -127,81 +127,81 @@ command =
[monitor-conf] [monitor-conf]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = {{ monitor_conf_template }} template = ${monitor-conf:location}/${monitor-conf:filename}
rendered = ${directory:etc}/${:filename} rendered = $${directory:etc}/$${:filename}
filename = monitor.conf filename = monitor.conf
context = section parameter_dict monitor-conf-parameters context = section parameter_dict monitor-conf-parameters
section monitor_base_urls monitor-base-url-dict section monitor_base_urls monitor-base-url-dict
[instance-info-parameters] [instance-info-parameters]
name = ${monitor-instance-parameter:monitor-title} name = $${monitor-instance-parameter:monitor-title}
root-name = ${monitor-instance-parameter:root-instance-title} root-name = $${monitor-instance-parameter:root-instance-title}
computer-id = ${slap-connection:computer-id} computer-id = $${slap-connection:computer-id}
ipv4 = ${slap-configuration:ipv4-random} ipv4 = $${slap-configuration:ipv4-random}
ipv6 = ${slap-configuration:ipv6-random} ipv6 = $${slap-configuration:ipv6-random}
software-release = ${slap-connection:software-release-url} software-release = $${slap-connection:software-release-url}
software-type = ${slap-configuration:slap-software-type} software-type = $${slap-configuration:slap-software-type}
partition-id = ${slap-connection:partition-id} partition-id = $${slap-connection:partition-id}
[monitor-instance-info] [monitor-instance-info]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = {{ monitor_instance_info }} template = ${monitor-instance-info:location}/${monitor-instance-info:filename}
rendered = ${directory:etc}/${:filename} rendered = $${directory:etc}/$${:filename}
filename = instance-info.conf filename = instance-info.conf
context = context =
section instance_dict instance-info-parameters section instance_dict instance-info-parameters
[python-symlink] [python-symlink]
recipe = plone.recipe.command recipe = plone.recipe.command
target = ${directory:bin} target = $${directory:bin}
command = ln -sf {{ python_with_eggs }} ${:target}/python command = ln -sf ${buildout:directory}/bin/${extra-eggs:interpreter} $${:target}/python
update-command = ${:command} update-command = $${:command}
[start-monitor] [start-monitor]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = {{ python_executable }} {{ monitor_bin }} --config_file ${monitor-conf:rendered} command-line = ${buildout:directory}/bin/${extra-eggs:interpreter} ${buildout:directory}/bin/monitor.bootstrap --config_file $${monitor-conf:rendered}
name = bootstrap-monitor name = bootstrap-monitor
wrapper-path = ${directory:scripts}/${:name} wrapper-path = $${directory:scripts}/$${:name}
environment = environment =
PATH=${python-symlink:target}:/usr/local/bin:/usr/bin:/bin PATH=$${python-symlink:target}:/usr/local/bin:/usr/bin:/bin
[monitor-htpasswd] [monitor-htpasswd]
recipe = slapos.cookbook:generate.password recipe = slapos.cookbook:generate.password
storage-path = ${directory:etc}/.monitor_pwd storage-path = $${directory:etc}/.monitor_pwd
bytes = 8 bytes = 8
[httpd-monitor-htpasswd] [httpd-monitor-htpasswd]
recipe = plone.recipe.command recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
password-file = ${directory:etc}/.monitor_pwd password-file = $${directory:etc}/.monitor_pwd
htpasswd-path = ${monitor-directory:etc}/monitor-htpasswd htpasswd-path = $${monitor-directory:etc}/monitor-htpasswd
# Keep multiple lines as password can end with newline char. # Keep multiple lines as password can end with newline char.
command = command =
if [ ! -s "${:htpasswd-path}" ]; then if [ ! -s "$${httpd-monitor-htpasswd:htpasswd-path}" ]; then
{{ apache_location }}/bin/htpasswd -cb ${:htpasswd-path} ${:user} ${:password} ${apache:location}/bin/htpasswd -cb $${:htpasswd-path} $${:user} $${:password}
fi fi
if [ ! -s "${:password-file}" ]; then echo "${monitor-instance-parameter:password}" > ${:password-file}; fi if [ ! -s "$${:password-file}" ]; then echo "$${monitor-instance-parameter:password}" > $${:password-file}; fi
update-command = ${:command} update-command = $${:command}
user = ${monitor-instance-parameter:username} user = $${monitor-instance-parameter:username}
password = ${monitor-instance-parameter:password} password = $${monitor-instance-parameter:password}
[monitor-httpd-conf-parameter] [monitor-httpd-conf-parameter]
listening-ip = ${monitor-instance-parameter:monitor-httpd-ipv6} listening-ip = $${monitor-instance-parameter:monitor-httpd-ipv6}
port = ${monitor-instance-parameter:monitor-httpd-port} port = $${monitor-instance-parameter:monitor-httpd-port}
pid-file = ${directory:run}/monitor-httpd.pid pid-file = $${directory:run}/monitor-httpd.pid
access-log = ${monitor-directory:log}/monitor-httpd-access.log access-log = $${monitor-directory:log}/monitor-httpd-access.log
error-log = ${monitor-directory:log}/monitor-httpd-error.log error-log = $${monitor-directory:log}/monitor-httpd-error.log
cert-file = ${ca-directory:certs}/httpd.crt cert-file = $${ca-directory:certs}/httpd.crt
key-file = ${ca-directory:certs}/httpd.key key-file = $${ca-directory:certs}/httpd.key
htpasswd-file = ${httpd-monitor-htpasswd:htpasswd-path} htpasswd-file = $${httpd-monitor-htpasswd:htpasswd-path}
url = https://[${monitor-instance-parameter:monitor-httpd-ipv6}]:${:port} url = https://[$${monitor-instance-parameter:monitor-httpd-ipv6}]:$${:port}
httpd-cors-config-file = ${monitor-httpd-cors:rendered} httpd-cors-config-file = $${monitor-httpd-cors:rendered}
httpd-include-file = httpd-include-file =
[monitor-httpd-conf] [monitor-httpd-conf]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = {{ monitor_httpd_template }} template = ${monitor-httpd-conf:location}/${monitor-httpd-conf:filename}
rendered = ${monitor-directory:etc}/monitor-httpd.conf rendered = $${monitor-directory:etc}/monitor-httpd.conf
mode = 0744 mode = 0744
context = context =
section directory monitor-directory section directory monitor-directory
...@@ -209,147 +209,147 @@ context = ...@@ -209,147 +209,147 @@ context =
[monitor-httpd-cors] [monitor-httpd-cors]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = {{ monitor_https_cors }} template = ${monitor-httpd-cors:location}/${monitor-httpd-cors:filename}
rendered = ${directory:etc}/httpd-cors.cfg rendered = $${directory:etc}/httpd-cors.cfg
mode = 0600 mode = 0600
context = context =
key domain monitor-instance-parameter:cors-domains key domain monitor-instance-parameter:cors-domains
[monitor-httpd-wrapper] [monitor-httpd-wrapper]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = {{ apache_location }}/bin/httpd -f ${monitor-httpd-conf:rendered} -DFOREGROUND command-line = ${apache:location}/bin/httpd -f $${monitor-httpd-conf:rendered} -DFOREGROUND
wrapper-path = ${directory:bin}/monitor-httpd wrapper-path = $${directory:bin}/monitor-httpd
wait-for-files = wait-for-files =
${ca-directory:certs}/httpd.key $${ca-directory:certs}/httpd.key
${ca-directory:certs}/httpd.crt $${ca-directory:certs}/httpd.crt
${monitor-httpd-graceful-wrapper:rendered} $${monitor-httpd-graceful-wrapper:rendered}
[monitor-httpd-graceful-wrapper] [monitor-httpd-graceful-wrapper]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = {{ template_wrapper }} template = ${monitor-template-wrapper:location}/${monitor-template-wrapper:filename}
rendered = ${directory:scripts}/monitor-httpd-graceful rendered = $${directory:scripts}/monitor-httpd-graceful
mode = 0700 mode = 0700
context = context =
key content :command key content :command
raw dash_binary {{ dash_executable_location }} raw dash_binary ${dash:location}/bin/dash
command = kill -USR1 $(cat ${monitor-httpd-conf-parameter:pid-file}) command = kill -USR1 $(cat $${monitor-httpd-conf-parameter:pid-file})
[xnice-bin] [xnice-bin]
recipe = collective.recipe.template recipe = collective.recipe.template
input = inline:#!/bin/sh input = inline:#!/bin/sh
# run something at lowest possible priority # run something at lowest possible priority
exec nice -19 chrt --idle 0 ionice -c3 "$@" exec nice -19 chrt --idle 0 ionice -c3 "$@"
output = ${directory:bin}/xnice output = $${directory:bin}/xnice
mode = 700 mode = 700
[promise-monitor-httpd-is-process-older-than-dependency-set] [promise-monitor-httpd-is-process-older-than-dependency-set]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = {{ bin_directory }}/is-process-older-than-dependency-set ${monitor-httpd-conf-parameter:pid-file} command-line = ${buildout:directory}/bin/is-process-older-than-dependency-set $${monitor-httpd-conf-parameter:pid-file}
wrapper-path = ${directory:promises}/promise-monitor-httpd-is-process-older-than-dependency-set wrapper-path = $${directory:promises}/promise-monitor-httpd-is-process-older-than-dependency-set
parameters-extra = true parameters-extra = true
[monitor-globalstate-wrapper] [monitor-globalstate-wrapper]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = ${xnice-bin:output} {{ monitor_genstatus }} '${monitor-conf:rendered}' '${monitor-instance-info:rendered}' command-line = $${xnice-bin:output} ${buildout:directory}/bin/monitor.genstatus '$${monitor-conf:rendered}' '$${monitor-instance-info:rendered}'
wrapper-path = ${directory:bin}/monitor-globalstate wrapper-path = $${directory:bin}/monitor-globalstate
[monitor-configurator-wrapper] [monitor-configurator-wrapper]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
# XXX - hard coded path # XXX - hard coded path
command-line = {{ monitor_configwrite }} --config_folder '${monitor-conf-parameters:private-folder}/config/.jio_documents' --output_cfg_file '${monitor-instance-parameter:configuration-file-path}' --htpasswd_bin '{{ apache_location }}/bin/htpasswd' --monitor_https_cors {{ monitor_https_cors }} command-line = ${buildout:directory}/bin/monitor.configwrite} --config_folder '$${monitor-conf-parameters:private-folder}/config/.jio_documents' --output_cfg_file '$${monitor-instance-parameter:configuration-file-path}' --htpasswd_bin '${apache:location}/bin/htpasswd' --monitor_https_cors ${monitor-template-wrapper:location}/${monitor-template-wrapper:filename}
wrapper-path = ${directory:bin}/monitor-configurator wrapper-path = $${directory:bin}/monitor-configurator
[monitor-globalstate-cron-entry] [monitor-globalstate-cron-entry]
recipe = slapos.cookbook:cron.d recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries} cron-entries = $${cron:cron-entries}
name = monitor-globalstate name = monitor-globalstate
frequency = * * * * * frequency = * * * * *
command = ${monitor-globalstate-wrapper:wrapper-path} command = $${monitor-globalstate-wrapper:wrapper-path}
[monitor-configurator-cron-entry] [monitor-configurator-cron-entry]
recipe = slapos.cookbook:cron.d recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries} cron-entries = $${cron:cron-entries}
name = monitor-configurator name = monitor-configurator
frequency = * * * * * frequency = * * * * *
command = ${monitor-configurator-wrapper:wrapper-path} command = $${monitor-configurator-wrapper:wrapper-path}
[monitor-httpd-promise] [monitor-httpd-promise]
recipe = slapos.cookbook:check_url_available recipe = slapos.cookbook:check_url_available
path = ${directory:promises}/${:filename} path = $${directory:promises}/$${:filename}
filename = monitor-httpd-listening-on-tcp filename = monitor-httpd-listening-on-tcp
url = ${monitor-httpd-conf-parameter:url} url = $${monitor-httpd-conf-parameter:url}
check-secure = 1 check-secure = 1
dash_path = {{ dash_executable_location }} dash_path = ${dash:location}/bin/dash
curl_path = {{ curl_executable_location }} curl_path = ${curl:location}/bin/curl
[monitor-publish-parameters] [monitor-publish-parameters]
# XXX depends on monitor-base section # XXX depends on monitor-base section
monitor-base-url = ${monitor-base:base-url} monitor-base-url = $${monitor-base:base-url}
monitor-url = ${:monitor-base-url}/public/feeds monitor-url = $${:monitor-base-url}/public/feeds
monitor-user = ${monitor-instance-parameter:username} monitor-user = $${monitor-instance-parameter:username}
monitor-password = ${monitor-instance-parameter:password} monitor-password = $${monitor-instance-parameter:password}
[install-monitor-apache] [install-monitor-apache]
recipe = plone.recipe.command recipe = plone.recipe.command
command = true command = true
update-command = update-command =
monitor-base-url = ${monitor-frontend-promise:url} # XXX - Set monitor-base-url = $${install-monitor-apache:monitor-base-url} => https://[ipv6]:port
monitor-base-url-ipv6 = ${monitor-httpd-conf-parameter:url} #monitor-base-url = $${monitor-frontend-promise:url}
monitor-base-url = $${monitor-httpd-conf-parameter:url}
depends = depends =
${certificate-authority:wrapper} $${certificate-authority:wrapper}
${ca-monitor-httpd:wrapper} $${ca-monitor-httpd:wrapper}
${monitor-httpd-promise:filename} $${monitor-httpd-promise:filename}
${promise-monitor-httpd-is-process-older-than-dependency-set:wrapper-path} $${promise-monitor-httpd-is-process-older-than-dependency-set:wrapper-path}
[monitor-instance-parameter] [monitor-instance-parameter]
monitor-title = ${slap-configuration:instance-title} monitor-title = $${slap-configuration:instance-title}
monitor-httpd-ipv6 = ${slap-configuration:ipv6-random} monitor-httpd-ipv6 = $${slap-configuration:ipv6-random}
monitor-httpd-port = 8196 monitor-httpd-port = 8196
# XXX - Set monitor-base-url = ${install-monitor-apache:monitor-base-url} => https://[ipv6]:port monitor-base-url = $${install-monitor-apache:monitor-base-url}
monitor-base-url = ${install-monitor-apache:monitor-base-url} root-instance-title = $${slap-configuration:root-instance-title}
#monitor-base-url = ${install-monitor-apache:monitor-base-url-ipv6}
root-instance-title = ${slap-configuration:root-instance-title}
monitor-url-list = monitor-url-list =
cors-domains = monitor.app.officejs.com cors-domains = softinst65443.host.vifib.net
#monitor.app.officejs.com
# XXX Hard coded parameter # XXX Hard coded parameter
collector-db = /srv/slapgrid/var/data-log/collector.db collector-db = /srv/slapgrid/var/data-log/collector.db
# Credentials # Credentials
password = ${monitor-htpasswd:passwd} password = $${monitor-htpasswd:passwd}
username = admin username = admin
# XXX: type key value # XXX: type key value
# ex raw monitor-password resqdsdsd34 # ex raw monitor-password resqdsdsd34
instance-configuration = instance-configuration =
configuration-file-path = ${monitor-directory:etc}/monitor_knowledge0.cfg configuration-file-path = $${monitor-directory:etc}/monitor_knowledge0.cfg
interface-url = https://monitor.app.officejs.com interface-url = https://monitor.app.officejs.com
[monitor-frontend] [monitor-frontend]
<= slap-connection <= slap-connection
recipe = slapos.cookbook:requestoptional recipe = slapos.cookbook:requestoptional
name = Monitor Frontend ${monitor-instance-parameter:monitor-title} name = Monitor Frontend $${monitor-instance-parameter:monitor-title}
# XXX We have hardcoded SR URL here. # XXX We have hardcoded SR URL here.
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true slave = true
config-url = ${monitor-httpd-conf-parameter:url} config-url = $${monitor-httpd-conf-parameter:url}
config-https-only = true config-https-only = true
#software-type = custom-personal #software-type = custom-personal
return = domain secure_access return = domain secure_access
[monitor-frontend-promise] [monitor-frontend-promise]
recipe = slapos.cookbook:check_url_available recipe = slapos.cookbook:check_url_available
path = ${directory:promises}/monitor-http-frontend path = $${directory:promises}/monitor-http-frontend
url = ${monitor-frontend:connection-secure_access} url = $${monitor-frontend:connection-secure_access}
dash_path = {{ dash_executable_location }} dash_path = ${dash:location}/bin/dash
curl_path = {{ curl_executable_location }} curl_path = ${curl:location}/bin/curl
check-secure = 1 check-secure = 1
[monitor-bootstrap-promise] [monitor-bootstrap-promise]
recipe = collective.recipe.template recipe = collective.recipe.template
file = ${monitor-conf-parameters:promise-output-file} file = $${monitor-conf-parameters:promise-output-file}
error-log-file = ${buildout:directory}/.${slap-connection:partition-id}_${start-monitor:name}.log error-log-file = $${buildout:directory}/.$${slap-connection:partition-id}_$${start-monitor:name}.log
input = inline:#!{{ dash_executable_location }} input = inline:#!${dash:location}/bin/dash
pidfile=${monitor-conf-parameters:pid-file} pidfile=$${monitor-conf-parameters:pid-file}
if [ -s $pidfile ]; then if [ -s $pidfile ]; then
COUNTER=0 COUNTER=0
# Wait until max 20 seconds, the limit promise timeout # Wait until max 20 seconds, the limit promise timeout
...@@ -362,9 +362,9 @@ input = inline:#!{{ dash_executable_location }} ...@@ -362,9 +362,9 @@ input = inline:#!{{ dash_executable_location }}
fi fi
done done
fi fi
if [ ! -f "${:file}" ]; then if [ ! -f "$${:file}" ]; then
echo "Monitor bootstrap exited with error." echo "Monitor bootstrap exited with error."
log_file="${:error-log-file}" log_file="$${:error-log-file}"
if [ -s "$log_file" ]; then if [ -s "$log_file" ]; then
echo " ---- Latest monitor-boostrap.log ----" echo " ---- Latest monitor-boostrap.log ----"
echo "" echo ""
...@@ -374,53 +374,53 @@ input = inline:#!{{ dash_executable_location }} ...@@ -374,53 +374,53 @@ input = inline:#!{{ dash_executable_location }}
else else
echo "Bootstrap OK"; echo "Bootstrap OK";
fi fi
output = ${directory:promises}/monitor-bootstrap-status output = $${directory:promises}/monitor-bootstrap-status
mode = 700 mode = 700
[promise-check-slapgrid] [promise-check-slapgrid]
recipe = collective.recipe.template recipe = collective.recipe.template
error-log-file = ${buildout:directory}/.slapgrid-${slap-connection:partition-id}-error.log error-log-file = $${buildout:directory}/.slapgrid-$${slap-connection:partition-id}-error.log
input = inline:#!/bin/sh input = inline:#!/bin/sh
if [ -f "${:error-log-file}" ]; then if [ -f "$${:error-log-file}" ]; then
>&2 cat ${:error-log-file} >&2 cat $${:error-log-file}
exit 1 exit 1
fi fi
output = ${monitor-directory:promises}/buildout-${slap-connection:partition-id}-status output = $${monitor-directory:promises}/buildout-$${slap-connection:partition-id}-status
mode = 700 mode = 700
[promise-check-free-disk-space] [promise-check-free-disk-space]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = {{ template_check_disk_space }} template = ${monitor-check-free-disk-space:location}/${monitor-check-free-disk-space:filename}
rendered = ${monitor-directory:promises}/check-free-disk-space rendered = $${monitor-directory:promises}/check-free-disk-space
mode = 0700 mode = 0700
context = context =
key config_file :config-file key config_file :config-file
raw home_path ${buildout:directory} raw home_path $${buildout:directory}
raw python_bin {{ python_with_eggs }} raw python_bin ${buildout:directory}/bin/${extra-eggs:interpreter}
config-file = ${directory:etc}/min-free-disk-size config-file = $${directory:etc}/min-free-disk-size
[monitor-base] [monitor-base]
# create dependencies between required monitor parts # create dependencies between required monitor parts
recipe = plone.recipe.command recipe = plone.recipe.command
command = true command = true
update-command = update-command =
base-url = ${monitor-conf-parameters:base-url} base-url = $${monitor-conf-parameters:base-url}
depends = depends =
${monitor-globalstate-cron-entry:name} $${monitor-globalstate-cron-entry:name}
${monitor-configurator-cron-entry:name} $${monitor-configurator-cron-entry:name}
${cron-entry-logrotate:name} $${cron-entry-logrotate:name}
${logrotate-entry-cron:name} $${logrotate-entry-cron:name}
${monitor-conf:rendered} $${monitor-conf:rendered}
${start-monitor:wrapper-path} $${start-monitor:wrapper-path}
${monitor-bootstrap-promise:file} $${monitor-bootstrap-promise:file}
${promise-check-slapgrid:output} $${promise-check-slapgrid:output}
[monitor-publish] [monitor-publish]
monitor-base-url = ${monitor-publish-parameters:monitor-base-url} monitor-base-url = $${monitor-publish-parameters:monitor-base-url}
monitor-setup-url = ${monitor-instance-parameter:interface-url}/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${monitor-publish-parameters:monitor-password} monitor-setup-url = $${monitor-instance-parameter:interface-url}/#page=settings_configurator&url=$${monitor-publish-parameters:monitor-url}&username=$${monitor-publish-parameters:monitor-user}&password=$${monitor-publish-parameters:monitor-password}
[buildout] [buildout]
extends = extends =
{{ template_logrotate_base }} ${template-logrotate-base:rendered}
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