paulbsd-salt/states/clickhouse/users.sls

23 lines
605 B
Plaintext
Raw Normal View History

2023-12-04 22:35:54 +01:00
---
{%- from "clickhouse/map.jinja" import clickhouse with context %}
2024-03-01 17:40:19 +01:00
clickhouse-users-folder:
file.directory:
2024-09-25 22:01:48 +02:00
- name: /etc/clickhouse-server/users.d
- clean: True
2024-03-01 17:40:19 +01:00
2023-12-04 22:35:54 +01:00
{% 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 }}
2024-09-25 22:27:42 +02:00
- require_in:
2024-09-25 22:24:30 +02:00
- file: clickhouse-users-folder
2023-12-04 22:35:54 +01:00
{% endfor %}