fix: bug in template with array

This commit is contained in:
Adrien Waksberg 2024-02-20 09:48:57 +01:00
parent eaf0b7e0c7
commit 58b7253198
2 changed files with 3 additions and 3 deletions

View file

@ -30,7 +30,7 @@ object Host "{{ name }}" {
}
{% endfor %}
{% elif value is iterable and not value is string %}
{{ var }} = [ "{{ value|join(', "') }}" ]
{{ var }} = [ "{{ value|join('", "') }}" ]
{% elif value is number or value|regex_search('^[0-9]+(s|m|h|d)$') %}
{{ var }} = {{ value }}
{% else %}
@ -55,7 +55,7 @@ object Host "{{ name }}" {
}
{% endfor %}
{% elif value is iterable and not value is string %}
vars.{{ var }} = [ "{{ value|join(', "') }}" ]
vars.{{ var }} = [ "{{ value|join('", "') }}" ]
{% elif value is number or value|regex_search('^[0-9]+(s|m|h|d)$') %}
vars.{{ var }} = {{ value }}
{% else %}

View file

@ -35,7 +35,7 @@ apply Service "{{ name }}" {
}
{% endfor %}
{% elif value is iterable and not value is string %}
vars.{{ var }} = [ "{{ value|join(', "') }}" ]
vars.{{ var }} = [ "{{ value|join('", "') }}" ]
{% elif value is number or value|regex_search('^[0-9]+(s|m|h|d)$') %}
vars.{{ var }} = {{ value }}
{% else %}