paulbsd-salt/states/nextcloud/templates/config.php.j2

26 lines
691 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
<?php
{%- from "nextcloud/map.jinja" import nextcloud with context %}
{%- macro mac(value,last) -%}
{%- if value is mapping %}
{%- for k, v in value.items() %}
"{{ k }}" => "{{ v }}"{% if last %},{% else %}{% endif %}
{%- endfor %}
{%- elif value is sequence and value is not string -%}
array(
{%- for value2 in value %}
{{ mac(value2,loop.last) }}
{%- endfor -%}
),
{%- elif value is true or value is false -%}
{{ value|lower }},
{%- elif value is number -%}
{{ value }},
{%- else -%}
"{{ value }}",
{%- endif %}
{%- endmacro %}
$CONFIG = array(
{%- for key, value in nextcloud.config.items() %}
"{{ key }}" => {{ mac(value,loop.last) }}
{%- endfor %}
);