Commit 17fd0fbf authored by Hardik Juneja's avatar Hardik Juneja

stack: Make monitor apache optional using a slap parameter

parent f89c42fb
......@@ -23,15 +23,15 @@ md5sum = dc974bd74cf967ae6250d81322629c44
[template-mariadb]
filename = instance-mariadb.cfg.in
md5sum = 3b6c19686ac52c2d452597dbacc88888
md5sum = 1894a05674a7f670692bb2e12ff44d9c
[template-kumofs]
filename = instance-kumofs.cfg.in
md5sum = 253027f37c4e5bd908e6af551848f03a
md5sum = 5ac90bdfd30156822b9702a8b73a4d8e
[template-cloudooo]
filename = instance-cloudoo.cfg.in
md5sum = 43253cbfd5d361047ba6a99b116b2370
md5sum = 53a669a7fd42c14596ad7d3a79dfe760
[template-zope-conf]
filename = zope.conf.in
......@@ -83,19 +83,19 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e
[template-erp5]
filename = instance-erp5.cfg.in
md5sum = 929b87c01aaf6ea1bbf6ff906ce9c0d9
md5sum = b8cb62bbbcbd7d85258aa63b14be9a20
[template-zeo]
filename = instance-zeo.cfg.in
md5sum = 2248d249cfc53c73e7c65665d4d53be0
md5sum = d04d0f67e399543004f5f363ff448052
[template-zope]
filename = instance-zope.cfg.in
md5sum = 6a64d1615c3ef9f6311c863d5aa0c58f
md5sum = f08e4750f66a3aa27c9379ae278bdd8c
[template-balancer]
filename = instance-balancer.cfg.in
md5sum = a3ad32c46bb56076895441edbd66018d
md5sum = 865efaf767a747d263edad9108a76191
[template-haproxy-cfg]
filename = haproxy.cfg.in
......
......@@ -230,6 +230,9 @@ monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ next_port() }}
monitor-title = Balancer monitor
password = {{ slapparameter_dict['monitor-passwd'] }}
{% if slapparameter_dict.get('monitor-disable-apache') -%}
monitor-base-url =
{% endif -%}
instance-configuration =
file apachedex-default ${apachedex-parameters:default}
file apachedex-base-list ${apachedex-parameters:base-list}
......
{% set bin_directory = parameter_dict['buildout-bin-directory'] -%}
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
{% set monitor_dict = slapparameter_dict.get('monitor', {}) %}
[buildout]
extends =
{{ parameter_dict['template-monitor'] }}
......@@ -112,6 +113,9 @@ framebuffer = ${:srv}/framebuffer
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ tcpv4_port + 2 }}
monitor-title = Cloudooo monitor
{% if slapparameter_dict.get('monitor-disable-apache') -%}
monitor-base-url =
{% endif -%}
password = {{ slapparameter_dict['monitor-passwd'] }}
[binary-link]
......
......@@ -8,6 +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_dict = slapparameter_dict.get('monitor', {}) %}
{% set monitor_base_url_dict = {} -%}
[request-common]
<= request-common-base
......@@ -38,10 +39,10 @@ config-{{ k }} = {{ '${' ~ v ~ '}' }}
{% endfor -%}
{% endmacro -%}
{{ 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}, {'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}, {'database-list': True, 'test-database-list': True, 'monitor-base-url': False}, key_config={'monitor-passwd': 'monitor-htpasswd:passwd'}) }}
{{ 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-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('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('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'}) }}
{% 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'}) }}
{%- else %}
......@@ -78,7 +79,7 @@ connection-url = smtp://127.0.0.2:0/
{% else -%}
{{ assert(server_type == 'zeo', server_type) -}}
{# 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}, 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, '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'}) }}
{% endif -%}
{% endfor -%}
......@@ -146,6 +147,7 @@ config-inituser-login = {{ dumps(inituser_login) }}
config-inituser-password = ${publish-early:inituser-password}
config-kumofs-url = ${request-memcached-persistent: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-mysql-test-url-list = ${request-mariadb:connection-test-database-list}
config-mysql-url-list = ${request-mariadb:connection-database-list}
......@@ -258,6 +260,7 @@ 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-backend-path = {{ dumps(balancer_dict.get('apache-backend-path', '/') % {'site-id': site_id}) }}
config-ssl = {{ dumps(balancer_dict.get('ssl', {})) }}
config-monitor-disable-apache = monitor_dict.get('disable-apache')
config-monitor-passwd = ${monitor-htpasswd:passwd}
......@@ -315,6 +318,9 @@ parts +=
[monitor-conf-parameters]
monitor-title = ERP5 monitor
password = ${monitor-htpasswd:passwd}
{% if monitor_dict.get('disable-apache') == True -%}
monitor-base-url =
{% endif -%}
[monitor-base-url-dict]
{% for key, value in monitor_base_url_dict.items() -%}
......
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
{% set monitor_dict = slapparameter_dict.get('monitor', {}) %}
[buildout]
extends =
{{ logrotate_cfg }}
......@@ -113,4 +114,7 @@ port = ${kumofs-instance:manager-port}
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ tcpv4_port + 4 }}
monitor-title = Kumofs monitor
{% if slapparameter_dict.get('monitor-disable-apache') -%}
monitor-base-url =
{% endif -%}
password = {{ slapparameter_dict['monitor-passwd'] }}
......@@ -17,6 +17,7 @@
{% set ip = (ipv4_set | list)[0] -%}
{% endif -%}
{% set dash = parameter_dict['dash-location'] ~ '/bin/dash' %}
{% set monitor_dict = slapparameter_dict.get('monitor', {}) %}
[{{ section('publish') }}]
recipe = slapos.cookbook:publish.serialised
......@@ -302,6 +303,9 @@ parameters-extra = true
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ port + 1 }}
monitor-title = Mariadb monitor
{% if slapparameter_dict.get('monitor-disable-apache') -%}
monitor-base-url =
{% endif -%}
password = {{ slapparameter_dict['monitor-passwd'] }}
[buildout]
......
......@@ -7,6 +7,7 @@
{% set default_zodb_path = buildout_directory ~ '/srv/zodb' -%}
{% set default_backup_path = buildout_directory ~ '/srv/backup/zodb' -%}
{% set bin_directory = parameter_dict['buildout-bin-directory'] -%}
{% set monitor_dict = slapparameter_dict.get('monitor', {}) %}
[zeo-base]
recipe = slapos.cookbook:zeo
......@@ -186,6 +187,9 @@ tidstorage = {{ tidstorage_repozo_path }}
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ next_port() }}
monitor-title = ZODB monitor
{% if monitor_dict.get('disable-apache') == True -%}
monitor-base-url =
{% endif -%}
password = {{ slapparameter_dict['monitor-passwd'] }}
[buildout]
......
......@@ -10,6 +10,7 @@
{% set longrequest_logger_base_path = buildout_directory ~ '/var/log/longrequest_logger_' -%}
{% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%}
{% 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
partition. No more (undefined result), no less (IndexError).
......@@ -395,6 +396,9 @@ bt5-repository-url = {{ dumps(slapparameter_dict['bt5-repository-url']) }}
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ next_port() }}
monitor-title = Zope monitor
{% if monitor_dict.get('disable-apache') == True -%}
monitor-base-url =
{% endif -%}
password = {{ slapparameter_dict['monitor-passwd'] }}
[buildout]
......
......@@ -15,4 +15,4 @@
# not need these here).
[monitor2-template]
filename = instance-monitor.cfg.jinja2.in
md5sum = 5027f0b1abcc28ce3817cd70fb667a3b
md5sum = 054cedcee5e3b82dca992c9ff45b85cd
......@@ -289,13 +289,25 @@ monitor-url = ${:monitor-base-url}/public/feeds
monitor-user = ${monitor-instance-parameter:username}
monitor-password = ${monitor-instance-parameter:password}
[install-monitor-apache]
recipe = plone.recipe.command
command = true
update-command =
monitor-base-url = ${monitor-frontend-promise:url}
monitor-base-url-ipv6 = ${monitor-httpd-conf-parameter:url}
depends =
${certificate-authority:wrapper}
${ca-monitor-httpd:wrapper}
${monitor-httpd-promise:filename}
${promise-monitor-httpd-is-process-older-than-dependency-set:wrapper-path}
[monitor-instance-parameter]
monitor-title = ${slap-configuration:instance-title}
monitor-httpd-ipv6 = ${slap-configuration:ipv6-random}
monitor-httpd-port = 8196
# XXX - Set monitor-base-url = ${monitor-httpd-conf-parameter:url} => https://[ipv6]:port
monitor-base-url = ${monitor-frontend-promise:url}
#monitor-base-url = ${monitor-httpd-conf-parameter:url}
# 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-ipv6}
root-instance-title = ${slap-configuration:root-instance-title}
monitor-url-list =
cors-domains = monitor.app.officejs.com
......@@ -387,7 +399,6 @@ context =
raw python_bin {{ python_with_eggs }}
config-file = ${directory:etc}/min-free-disk-size
[monitor-base]
# create dependencies between required monitor parts
recipe = plone.recipe.command
......@@ -399,14 +410,10 @@ depends =
${monitor-configurator-cron-entry:name}
${cron-entry-logrotate:name}
${logrotate-entry-cron:name}
${certificate-authority:wrapper}
${monitor-conf:rendered}
${start-monitor:wrapper-path}
${ca-monitor-httpd:wrapper}
${monitor-httpd-promise:filename}
${monitor-bootstrap-promise:file}
${promise-check-slapgrid:output}
${promise-monitor-httpd-is-process-older-than-dependency-set:wrapper-path}
[monitor-publish]
monitor-base-url = ${monitor-publish-parameters:monitor-base-url}
......
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