Skip to content

Commit

Permalink
Merge pull request #72 from idealista/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jmonterrubio authored Jan 31, 2024
2 parents 0b9e73b + 2b2558e commit ee8da6b
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch

## [Unreleased](https://github.com/idealista/clickhouse_role/tree/develop)

## [3.5.0(https://github.com/idealista/clickhouse_role/tree/3.5.0 (2024-01-31)

### :heavy_plus_sign: Added

- [#70](https://github.com/idealista/clickhouse_role/issues/70) Include extra config and users files
- Update default lts version to latest (23.8.9.54)

## [3.4.1(https://github.com/idealista/clickhouse_role/tree/3.4.1 (2024-01-26)

### :hammer_and_wrench: Fixed
Expand Down
4 changes: 3 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## General
# Version
clickhouse_version: 22.8.8.3
clickhouse_version: 23.8.9.54
clickhouse_release_type: lts # Values should be: stable, lts or testing
clickhouse_install_db: True
clickhouse_install_bridge: False
Expand Down Expand Up @@ -83,6 +83,8 @@ clickhouse_user_files_directory: "{{ clickhouse_base_path }}/user_files"
clickhouse_access_control_directory: "{{ clickhouse_base_path }}/access/"
# clickhouse_custom_config_file_path: "{{ playbook_dir }}/config_files/config"
# clickhouse_custom_users_file_path: "{{ playbook_dir }}/config_files/users"
# clickhouse_custom_extra_config_file_path: "{{ playbook_dir }}/config_files/config/config.d"
# clickhouse_custom_extra_users_file_path: "{{ playbook_dir }}/config_files/users/users.d"

# Logs
clickhouse_logger:
Expand Down
13 changes: 13 additions & 0 deletions molecule/default/config_files/config/config.d/log_disable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<clickhouse>
<asynchronous_metric_log remove="1"/>
<metric_log remove="1"/>
<query_views_log remove="1" />
<part_log remove="1"/>
<session_log remove="1"/>
<text_log remove="1" />
<trace_log remove="1"/>
<crash_log remove="1"/>
<opentelemetry_span_log remove="1"/>
<zookeeper_log remove="1"/>
</clickhouse>
8 changes: 8 additions & 0 deletions molecule/default/config_files/users/users.d/log_queries.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<clickhouse>
<profiles>
<default>
<log_queries>0</log_queries>
<log_query_threads>0</log_query_threads>
</default>
</profiles>
</clickhouse>
4 changes: 2 additions & 2 deletions molecule/default/group_vars/clickhouse_group.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ clickhouse_role_manage_settings_profiles: True
clickhouse_role_manage_quotas: True
clickhouse_role_manage_grants: True

# clickhouse_custom_config_file_path: "{{ playbook_dir }}/config_files/config"
# clickhouse_custom_users_file_path: "{{ playbook_dir }}/config_files/users"
clickhouse_custom_extra_config_file_path: "{{ playbook_dir }}/config_files/config/config.d"
clickhouse_custom_extra_users_file_path: "{{ playbook_dir }}/config_files/users/users.d"

# Users
clickhouse_admin_user: admin
Expand Down
10 changes: 10 additions & 0 deletions molecule/default/tests/test_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ file:
group: {{ clickhouse_group }}
exists: true
filetype: file
"{{ clickhouse_config_directory_config_d }}/log_disable.xml":
owner: {{ clickhouse_user }}
group: {{ clickhouse_group }}
exists: true
filetype: file
"{{ clickhouse_config_directory_users_d }}/log_queries.xml":
owner: {{ clickhouse_user }}
group: {{ clickhouse_group }}
exists: true
filetype: file

service:
{{ clickhouse_service }}:
Expand Down
20 changes: 20 additions & 0 deletions tasks/config/clickhouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
notify: "{{ clickhouse_handler_on_config_change }}"
tags: clickhouse_configure

- name: CLICKHOUSE | Add extra configuration files
copy:
src: "{{ clickhouse_custom_extra_config_file_path }}/"
dest: "{{ clickhouse_config_directory_config_d }}/"
owner: "{{ clickhouse_user }}"
group: "{{ clickhouse_group }}"
mode: 0644
when: clickhouse_custom_extra_config_file_path is defined
tags: clickhouse_configure

- name: CLICKHOUSE | Configure users (from vars)
template:
src: "{{ clickhouse_users_file_name }}.j2"
Expand All @@ -43,3 +53,13 @@
tags:
- clickhouse_configure
- clickhouse_users

- name: CLICKHOUSE | Add extra user configuration files
copy:
src: "{{ clickhouse_custom_extra_users_file_path }}/"
dest: "{{ clickhouse_config_directory_users_d }}/"
owner: "{{ clickhouse_user }}"
group: "{{ clickhouse_group }}"
mode: 0644
when: clickhouse_custom_extra_users_file_path is defined
tags: clickhouse_configure

0 comments on commit ee8da6b

Please sign in to comment.