diff --git a/stack/lamp/buildout.cfg b/stack/lamp/buildout.cfg index 87c0fb1da351382cfd3d2282eaea25b28dd82165..19be4d8f1f8f04207ee7b4c3aa17230d11fc1bb1 100644 --- a/stack/lamp/buildout.cfg +++ b/stack/lamp/buildout.cfg @@ -63,6 +63,8 @@ part-list = # database information db-name = lamp db-user = lamp +# Publish default lamp slave frontend url +default-frontend = True #---------------- #-- Instance-level buildout profiles. @@ -113,6 +115,7 @@ context = key custom_application_template custom-application-deployment:path key db_name custom-application-deployment:db-name key db_user custom-application-deployment:db-user + key default_frontend custom-application-deployment:default-frontend key lamp_apache_httpd template-apache-httpd:target [instance-apache-php] diff --git a/stack/lamp/buildout.hash.cfg b/stack/lamp/buildout.hash.cfg index c7dfba41a764b8fa14dcbddfd27631f78e7bb01d..498cb7130b1c8d2cc101f8283933f2b712f59d19 100644 --- a/stack/lamp/buildout.hash.cfg +++ b/stack/lamp/buildout.hash.cfg @@ -14,15 +14,15 @@ # not need these here). [lamp-instance] filename = instance.cfg.in -md5sum = 7854dd0edd48f2d91c16412c4a875ca4 +md5sum = 6395a5d69e2fee494a7d00fd2ac563cb [instance-apache-php] filename = instance-apache-php.cfg.in -md5sum = 1e4762a6a7631d517fb45c84f9c989fe +md5sum = 41602a61d5f9609281dbfa3f27da0626 [instance-lamp] filename = instance-lamp.cfg.jinja2.in -md5sum = 347ddf1516bf2ddb5f6fb23539382847 +md5sum = de1f450a80547d12334b712016138078 [template-apache.conf] filename = apache.conf.in diff --git a/stack/lamp/instance-apache-php.cfg.in b/stack/lamp/instance-apache-php.cfg.in index b6be2b91ef033003dacd321ee22ea2bed5977da7..49ebe0300d0e0b4f5faf49865102d7c65f2df3d3 100644 --- a/stack/lamp/instance-apache-php.cfg.in +++ b/stack/lamp/instance-apache-php.cfg.in @@ -152,7 +152,7 @@ context = [apache-php-conf] recipe = slapos.recipe.template:jinja2 url = {{ parameter_dict['template-apache-conf'] }} -output = ${directory:etc}/apache.confgraceful +output = ${directory:etc}/apache.conf context = section parameter_dict apache-php-configuration extensions = jinja2.ext.do @@ -230,6 +230,27 @@ command-line = ${instance-parameter:php-bin} -c ${php.ini-conf:output} <= monitor-publish recipe = slapos.cookbook:publish.serialised backend-url = ${apache-php-configuration:url} +{% if parameter_dict['publish-frontend'] -%} +url = ${lamp-frontend-promise:url} +{% endif -%} + +[request-frontend] +<= slap-connection +recipe = slapos.cookbook:requestoptional +name = Instance Frontend +# XXX We have hardcoded SR URL here. +software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg +shared = true +config-url = ${apache-php-configuration:url} +config-https-only = true +return = domain secure_access + +[lamp-frontend-promise] +<= monitor-promise-base +promise = check_url_available +name = lamp-http-frontend.py +url = ${request-frontend:connection-secure_access} +config-url = ${:url} #---------------- diff --git a/stack/lamp/instance-lamp.cfg.jinja2.in b/stack/lamp/instance-lamp.cfg.jinja2.in index 0cfc4aea0b49474f8ead8de39ff64eceb8485fc0..6b98a8c195d3c07f64ed6f1edefaacc9f18a9d3f 100644 --- a/stack/lamp/instance-lamp.cfg.jinja2.in +++ b/stack/lamp/instance-lamp.cfg.jinja2.in @@ -30,11 +30,13 @@ config-{{ key }} = {{ dumps(value) }} config-monitor-passwd = ${monitor-instance-parameter:password} config-database-list = ${request-mariadb:connection-database-list} return = + url backend-url monitor-base-url {% do part_list.append('request-apache') -%} {% do publish_dict.__setitem__('backend-url', '${request-apache:connection-backend-url}') -%} +{% do publish_dict.__setitem__('url', '${request-apache:connection-url}') -%} {% do monitor_base_url_dict.__setitem__('apache', '${request-apache:connection-monitor-base-url}') -%} [request-mariadb] @@ -59,27 +61,6 @@ return = {% do publish_dict.__setitem__('mariadb-url-list', '${request-mariadb:connection-database-list}') -%} {% do monitor_base_url_dict.__setitem__('mariadb', '${request-mariadb:connection-monitor-base-url}') -%} -[request-frontend] -<= slap-connection -recipe = slapos.cookbook:requestoptional -name = Instance Frontend -# XXX We have hardcoded SR URL here. -software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg -shared = true -config-url = ${request-apache:connection-backend-url} -config-https-only = true -return = domain secure_access - -[lamp-frontend-promise] -<= monitor-promise-base -promise = check_url_available -name = lamp-http-frontend.py -url = ${request-frontend:connection-secure_access} -config-url = ${:url} -config-custom-domain = {{ slapparameter_dict.get('custom-domain', '') }} - -{% do publish_dict.__setitem__('url', '${lamp-frontend-promise:url}') -%} - [publish-early] recipe = slapos.cookbook:publish-early -init = diff --git a/stack/lamp/instance.cfg.in b/stack/lamp/instance.cfg.in index afe65658c183d4c4f673fcd1eeab5d1662a50974..a1303f18df79b03990df134d25c7173b6ab005e0 100644 --- a/stack/lamp/instance.cfg.in +++ b/stack/lamp/instance.cfg.in @@ -67,6 +67,7 @@ template-apache-conf = {{ template_apache_conf }} apache-location = {{ apache_location }} apache-php-location = {{ apache_php_location }} template-php-ini = {{ template_php_ini }} +publish-frontend = !py!{{ default_frontend }} # XXX no failure if `custom_application_template` is empty [application-parameters]