paulbsd-salt/states/clickhouse/templates/user.xml.j2
Paul d18a73ecc0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
updated clickhouse state
2024-03-01 17:40:19 +01:00

27 lines
967 B
Django/Jinja

{%- from "clickhouse/map.jinja" import clickhouse with context -%}
<clickhouse>
<users>
<{{ name }}>
{%- if params.networks|default(None) %}
<networks>
{%- for network in params.networks|default(["127.0.0.1/8"]) %}
<ip>{{ network }}</ip>
{%- endfor %}
</networks>
{%- endif %}
<profile>{{ params.profile|default("default") }}</profile>
<quota>{{ params.quota|default("default") }}</quota>
<default_database>{{ params.default_database|default("default") }}</default_database>
<access_management>{{ params.access_management|default(0)}}</access_management>
{%- if params.databases|default([])|length > 0 %}
<allow_databases>
{%- for database in params.databases|default([]) %}
<database>{{ database }}</database>
{%- endfor %}
</allow_databases>
{%- endif %}
<password>{{ params.password|default("") }}</password>
</{{ name }}>
</users>
</clickhouse>