Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Change task of ready of clickhouse server. #42

Merged
merged 1 commit into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ clickhouse_users_default:
- { name: "default", password: "", networks: "{{ clickhouse_networks_default }}", profile: "default", quota: "default", comment: "Default user for login if user not defined" }
- { name: "readonly", password: "", networks: "{{ clickhouse_networks_default }}", profile: "default", quota: "default", comment: "Example of user with readonly access" }

clickhouse_ready_retries: 3
clickhouse_ready_delay: 5

#Full form { name:'<username>', password: '<plainpassword>', password_sha256_hex: '<sha256password>',
# networks:"<{} with nets>", profile:'<profile>', quota:'<quota>', dbs: '{} with dbs', comment: '<some comment>'}
#Req: name, password or password_256_hex
Expand Down
12 changes: 9 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@
when: clickhouse_rt_is_installed.rc == 0 and clickhouse_remove|bool == False
tags: [config,config_sys]

- name: Wait DBMS ready
command: sleep 1
- name: Check clickhouse server is ready
command: "clickhouse-client -h 127.0.0.1 -q 'select 1'"
changed_when: False
retries: "{{ clickhouse_ready_retries }}"
delay: "{{ clickhouse_ready_delay }}"
register: clickhouse_rt_ready
until: clickhouse_rt_ready.rc == 0
tags: [config,config_sys]

- include: config_db.yml
when: clickhouse_rt_is_installed.rc == 0 and clickhouse_remove|bool == False
Expand All @@ -39,4 +45,4 @@
- "remove_{{ ansible_pkg_mgr }}.yml"
- "empty.yml"
when: clickhouse_setup == 'package' and clickhouse_rt_is_installed.rc == 0 and clickhouse_remove|bool == True
tags: [remove]
tags: [remove]