paulbsd-salt/states/clickhouse/users.sls
Paul Lecuq d95ee21c7b
All checks were successful
continuous-integration/drone/push Build is passing
updated clickhouse state
2024-09-25 22:24:30 +02:00

23 lines
604 B
Plaintext

---
{%- from "clickhouse/map.jinja" import clickhouse with context %}
clickhouse-users-folder:
file.directory:
- name: /etc/clickhouse-server/users.d
- clean: True
{% for user, params in clickhouse.users.items() %}
clickhouse-user-{{ user }}:
file.managed:
- name: /etc/clickhouse-server/users.d/{{ user }}.xml
- source: salt://clickhouse/templates/user.xml.j2
- user: clickhouse
- group: clickhouse
- mode: 600
- template: jinja
- context:
name: {{ user }}
params: {{ params }}
- require_in
- file: clickhouse-users-folder
{% endfor %}