Commit cafcac83 authored by Alain Takoudjou's avatar Alain Takoudjou

stack/lamp: allow to publish custom connexion parameters

parent 71b0f54e
...@@ -61,12 +61,15 @@ archive-root = ...@@ -61,12 +61,15 @@ archive-root =
# See software/maarch/software.cfg for an example. # See software/maarch/software.cfg for an example.
path = path =
part-list = part-list =
# Additional connexion parameters to publish from instance-apache-php
publish-list =
# database information # database information
db-name = lamp db-name = lamp
db-user = lamp db-user = lamp
# Publish default lamp slave frontend url # Publish default lamp slave frontend url
default-frontend = True default-frontend = True
[composer] [composer]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = https://getcomposer.org/installer url = https://getcomposer.org/installer
...@@ -129,6 +132,7 @@ context = ...@@ -129,6 +132,7 @@ context =
key application_location application:location key application_location application:location
key application_archive_root application:archive-root key application_archive_root application:archive-root
key application_deployment_part_list custom-application-deployment:part-list key application_deployment_part_list custom-application-deployment:part-list
key application_deployment_publish_list custom-application-deployment:publish-list
key apache_location apache:location key apache_location apache:location
key apache_php_location apache-php:location key apache_php_location apache-php:location
key bash_location bash:location key bash_location bash:location
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# not need these here). # not need these here).
[lamp-instance] [lamp-instance]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 0fa7f628756b7ba10b651fe5549def89 md5sum = 8940540752d7eef8dc625a31393ca14e
[instance-apache-php] [instance-apache-php]
filename = instance-apache-php.cfg.in filename = instance-apache-php.cfg.in
...@@ -22,7 +22,7 @@ md5sum = 765372ad68b61f117f666f30f0ad153f ...@@ -22,7 +22,7 @@ md5sum = 765372ad68b61f117f666f30f0ad153f
[instance-lamp] [instance-lamp]
filename = instance-lamp.cfg.jinja2.in filename = instance-lamp.cfg.jinja2.in
md5sum = de1f450a80547d12334b712016138078 md5sum = 5666756bed63a050df4119384b542ace
[template-apache.conf] [template-apache.conf]
filename = apache.conf.in filename = apache.conf.in
......
...@@ -33,7 +33,12 @@ return = ...@@ -33,7 +33,12 @@ return =
url url
backend-url backend-url
monitor-base-url monitor-base-url
{% for param in parameter_dict['application-publish-list'].split('\n') -%}
{% if param.strip() -%}
{{ ' ' ~ param }}
{% do publish_dict.__setitem__(param, '${request-apache:connection-' ~ param.strip() ~'}') -%}
{% endif -%}
{% endfor -%}
{% do part_list.append('request-apache') -%} {% do part_list.append('request-apache') -%}
{% do publish_dict.__setitem__('backend-url', '${request-apache:connection-backend-url}') -%} {% do publish_dict.__setitem__('backend-url', '${request-apache:connection-backend-url}') -%}
{% do publish_dict.__setitem__('url', '${request-apache:connection-url}') -%} {% do publish_dict.__setitem__('url', '${request-apache:connection-url}') -%}
......
...@@ -46,6 +46,7 @@ context = ...@@ -46,6 +46,7 @@ context =
recipe = slapos.cookbook:generate.password recipe = slapos.cookbook:generate.password
[dynamic-template-lamp-parameters] [dynamic-template-lamp-parameters]
application-publish-list = {{ application_deployment_publish_list.split('\n') | join('\n ') }}
[dynamic-template-lamp] [dynamic-template-lamp]
<= jinja2-template-base <= jinja2-template-base
......
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