Commit 496643ba authored by Nirina Malard's avatar Nirina Malard

software/html5as-base: add simple replicate

parent 9c00a0b9
......@@ -18,7 +18,7 @@
[template-cfg]
filename = instance.cfg.in
md5sum = c5197be13b0986a12c31bf670e887f27
md5sum = 0f030af59547866bbebff22f4b29cef3
[instance_html5as]
_update_hash_filename_ = instance_html5as.cfg.in
......@@ -43,3 +43,7 @@ md5sum = d57cb01df5941e139b02a2f7bdabcdc8
[template_graceful]
_update_hash_filename_ = templates/graceful.in
md5sum = 1c0ee16966e1fcdb3fd11c09f12ee2b2
[template_instance_replicate]
_update_hash_filename_ = instance_replicate.cfg.in
md5sum = 01fc8287b5429d21906a649d1163a51f
......@@ -39,10 +39,34 @@ default-parameters =
"monitor-httpd-port": 8197
}
[instance-replicate]
recipe = slapos.recipe.template:jinja2
url = {{ template_instance_replicate }}
output = ${buildout:directory}/${:filename}
filename = instance-replicate-html5as.cfg
context =
section buildout buildout
section parameter_list profile-common
key slapparameter_dict slap-configuration:configuration
jsonkey default_parameter_dict :default-parameters
# User can specify parameter for any of the two instances
default-parameters =
{
"title": "",
"title1": "",
"title2": "",
"download_url": "",
"port1": 8081,
"port2": 8082,
"monitor-httpd-port1": 8197,
"monitor-httpd-port2": 8198
}
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
RootSoftwareInstance = ${:default}
default = instance-html5as:output
replicate = instance-replicate:output
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
......
{% set parameter_dict = dict(default_parameter_dict, **slapparameter_dict) %}
# Standard buildout section
[buildout]
parts =
publish-connection-information
eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true
################################
# Sections to Request instances
################################
# Macro section sharing request parameters
[instance-request-base]
<= slap-connection
recipe = slapos.cookbook:request
# It is the same software as the current one
software-url = ${slap-connection:software-release-url}
# We want the default behaviour
software-type = default
# What parameter are neede to be retrieved
return = server_url server-cdn-url monitor-setup-url
# Provided parameters
config-title = {{ parameter_dict['title'] }}
config-download_url = {{ parameter_dict['download_url'] }}
# Request a normal html5as instance
[instance-1]
<= instance-request-base
# Name of the instance
name = instance-html5as-1
# Port and title can be configured by instance
config-port = {{ parameter_dict['port1'] }}
config-title = {{ parameter_dict['title1'] }}
config-monitor-httpd-port = {{ parameter_dict['monitor-httpd-port1'] }}
# Request a second html5as instance
[instance-2]
<= instance-request-base
# Name of the instance
name = instance-html5as-2
config-port = {{ parameter_dict['port2'] }}
config-title = {{ parameter_dict['title2'] }}
config-monitor-httpd-port = {{ parameter_dict['monitor-httpd-port2'] }}
# Publish information to connect to the two instances
[publish-connection-information]
recipe = slapos.cookbook:publish
instance-1-server_url = ${instance-1:connection-server_url}
instance-1-server-cdn-url = ${instance-1:connection-server-cdn-url}
instance-1-server-monitor-setup-url = ${instance-1:connection-monitor-setup-url}
instance-2-server_url = ${instance-2:connection-server_url}
instance-2-server-cdn-url = ${instance-1:connection-server-cdn-url}
instance-2-server-monitor-setup-url = ${instance-1:connection-monitor-setup-url}
......@@ -43,6 +43,7 @@ context =
key template_instance_html5as_target instance_html5as:target
key template_index_html_target template_index_html:target
key template_graceful_target template_graceful:target
key template_instance_replicate template_instance_replicate:target
key template_monitor monitor2-template:output
[download-base]
......@@ -68,6 +69,9 @@ url = ${:_profile_base_location_}/${:_update_hash_filename_}
[template_graceful]
<= download-base
[template_instance_replicate]
<= download-base
[extra-eggs]
recipe = zc.recipe.egg
eggs =
......
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