Commit 0fa7adc3 authored by Lisa Casino's avatar Lisa Casino

software/html5as-base: add simple replicate

parent 1727b88b
......@@ -17,7 +17,7 @@
[template-cfg]
filename = instance.cfg.in
md5sum = d52a24adf6a4cb1c514b657c63ebf7a5
md5sum = 1d2d49bcd32002703b470a2af048fa6c
[instance_html5as]
_update_hash_filename_ = instance_html5as.cfg.in
......@@ -42,3 +42,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
template = {{ template_instance_replicate }}
rendered = ${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:rendered
replicate = instance-replicate:rendered
[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}
......@@ -46,6 +46,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:rendered
[download-base]
......@@ -73,6 +74,9 @@ mode = 0644
[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