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

31 lines
832 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() %}
2020-07-30 14:06:59 +02:00
{%- if v is true or v is false or v is number %}
"{{ k }}" => {{ v|lower }}{% if last %},{% else %}{% endif %}
{%- else %}
2020-07-10 00:58:55 +02:00
"{{ k }}" => "{{ v }}"{% if last %},{% else %}{% endif %}
2020-07-30 14:06:59 +02:00
{%- endif %}
2020-07-10 00:58:55 +02:00
{%- 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 %}
2020-07-30 14:06:59 +02:00
);