๐Ÿ“— Ansible playbooks and roles for building an idempotent, interconnected and scalable infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-playbooks/roles/seafile/templates/seafile.j2

21 lines
587 B

2 years ago
{% macro seaf_option(option) -%}
{%- if option.value is boolean -%}
{{- option.key | lower }} = {{ 'true' if option.value else 'false' -}}
{%- else -%}
{{- option.key | lower }} = {{ option.value -}}
{%- endif -%}
{% endmacro -%}
{% macro seaf_block(name, block) -%}
{%- if block | type_debug == 'dict' -%}
[{{ name }}]
{% for option in (block | d({}) | dict2items) %}
{{- seaf_option(option) }}
{% endfor -%}
{%- endif -%}
{% endmacro -%}
{% for block in (seaf_cfg.seafile | d({}) | dict2items) -%}
{{ seaf_block(block.key, block.value) }}
{% endfor -%}