Commit bf99bfa7 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

apache-frontend : add replicate magic with software types

parent 8372fb62
{% if software_type == slap_software_type -%} {% if slap_software_type.startswith(software_type) -%}
[jinja2-template-base] [jinja2-template-base]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
...@@ -13,7 +13,13 @@ context = ...@@ -13,7 +13,13 @@ context =
${:extra-context} ${:extra-context}
{% set part_list = [] -%} {% set part_list = [] -%}
{% set type_key = 'replicate-' %}
{% set type_key_length = type_key | length %}
{% if slap_software_type.startswith(type_key) %}
{% set frontend_type = slap_software_type[type_key_length:] -%}
{% else -%}
{% set frontend_type = slapparameter_dict.pop('-frontend-type', 'default') -%} {% set frontend_type = slapparameter_dict.pop('-frontend-type', 'default') -%}
{% endif -%}
{% set frontend_quantity = slapparameter_dict.pop('-frontend-quantity', '2') | int -%} {% set frontend_quantity = slapparameter_dict.pop('-frontend-quantity', '2') | int -%}
{% set slave_list_name = 'extra_slave_instance_list' -%} {% set slave_list_name = 'extra_slave_instance_list' -%}
{% set frontend_list = [] %} {% set frontend_list = [] %}
......
...@@ -33,6 +33,9 @@ recipe = slapos.cookbook:softwaretype ...@@ -33,6 +33,9 @@ recipe = slapos.cookbook:softwaretype
default = ${template-apache-frontend:output} default = ${template-apache-frontend:output}
custom-personal = ${template-apache-frontend:output} custom-personal = ${template-apache-frontend:output}
custom-group = ${template-apache-frontend:output} custom-group = ${template-apache-frontend:output}
replicate-default = $${dynamic-template-apache-replicate:rendered}
replicate-custom-personal = $${dynamic-template-apache-replicate:rendered}
replicate-custom-group = $${dynamic-template-apache-replicate:rendered}
replicate = $${dynamic-template-apache-replicate:rendered} replicate = $${dynamic-template-apache-replicate:rendered}
[dynamic-template-apache-replicate] [dynamic-template-apache-replicate]
......
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