Skip to content

Commit

Permalink
Add no-restart flag for user files
Browse files Browse the repository at this point in the history
  • Loading branch information
brazhin committed Dec 4, 2024
1 parent d306c4e commit 2d809da
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tasks/pre_configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,9 @@
set_fact:
_user_configs: "{{
_user_configs | default([]) + ((item is mapping) | ternary(
[{'file': item.file, 'no_log': item.no_log | default(False)}],
[{'file': item, 'no_log': False}]
))
}}" # noqa: jinja[spacing]
[{'file': item.file, 'no_log': item.no_log | default(False), 'no_restart': item.no_restart | default(False)}],
[{'file': item, 'no_log': False, 'no_restart': False}]
)) }}" # noqa: jinja[spacing]
loop: "{{ common_user_configs + clickhouse_user_files | default([]) }}"
- name: Deploy clickhouse-server users overrides (requires restart)
template:
Expand All @@ -177,7 +176,16 @@
mode: "u=r,go="
notify: restart-clickhouse
no_log: "{{ item.no_log }}"
loop: "{{ _user_configs }}"
loop: "{{ _user_configs | selectattr('no_restart', 'eq', False) }}"
- name: Deploy clickhouse-server users overrides (without restart)
template:
src: "{{ (item is mapping) | ternary(item.file, item) }}.j2"
dest: "/etc/clickhouse-server/users.d/{{ (item is mapping) | ternary(item.file, item) | basename }}"
owner: clickhouse
group: clickhouse
mode: "u=r,go="
no_log: "{{ item.no_log }}"
loop: "{{ _user_configs | selectattr('no_restart', 'eq', True) }}"
- name: Deploy dictionaries configuration (requires restart)
template:
src: "{{ item }}.j2"
Expand Down

0 comments on commit 2d809da

Please sign in to comment.