|
163 | 163 | set_fact: |
164 | 164 | _user_configs: "{{ |
165 | 165 | _user_configs | default([]) + ((item is mapping) | ternary( |
166 | | - [{'file': item.file, 'no_log': item.no_log | default(False)}], |
167 | | - [{'file': item, 'no_log': False}] |
168 | | - )) |
169 | | - }}" # noqa: jinja[spacing] |
| 166 | + [{'file': item.file, 'no_log': item.no_log | default(False), 'no_restart': item.no_restart | default(False)}], |
| 167 | + [{'file': item, 'no_log': False, 'no_restart': False}] |
| 168 | + )) }}" # noqa: jinja[spacing] |
170 | 169 | loop: "{{ common_user_configs + clickhouse_user_files | default([]) }}" |
171 | 170 | - name: Deploy clickhouse-server users overrides (requires restart) |
172 | 171 | template: |
|
177 | 176 | mode: "u=r,go=" |
178 | 177 | notify: restart-clickhouse |
179 | 178 | no_log: "{{ item.no_log }}" |
180 | | - loop: "{{ _user_configs }}" |
| 179 | + loop: "{{ _user_configs | selectattr('no_restart', 'eq', False) }}" |
| 180 | + - name: Deploy clickhouse-server users overrides (without restart) |
| 181 | + template: |
| 182 | + src: "{{ (item is mapping) | ternary(item.file, item) }}.j2" |
| 183 | + dest: "/etc/clickhouse-server/users.d/{{ (item is mapping) | ternary(item.file, item) | basename }}" |
| 184 | + owner: clickhouse |
| 185 | + group: clickhouse |
| 186 | + mode: "u=r,go=" |
| 187 | + no_log: "{{ item.no_log }}" |
| 188 | + loop: "{{ _user_configs | selectattr('no_restart', 'eq', True) }}" |
181 | 189 | - name: Deploy dictionaries configuration (requires restart) |
182 | 190 | template: |
183 | 191 | src: "{{ item }}.j2" |
|
0 commit comments