community.clickhouse.clickhouse_info module – Gather ClickHouse server information using the clickhouse-driver Client interface
Note
This module is part of the community.clickhouse collection (version 2.1.0).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.clickhouse. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: community.clickhouse.clickhouse_info.
New in community.clickhouse 0.1.0
Synopsis
- Gather ClickHouse server information using the clickhouse-driver Client interface.
- Does not change server state.
Requirements
The below requirements are needed on the host that executes this module.
- clickhouse-driver
Parameters
Parameter | Comments |
|---|---|
client_kwargs dictionary | Any additional keyword arguments you want to pass to the Client interface when instantiating its object. Default: |
limit list / elements=string added in community.clickhouse 0.2.0 | Limits a set of return values you want to get. See the Return section for acceptable values. If not specified, returns all supported return values. |
login_db string | The same as the If not passed, relies on the driver’s default argument value. |
login_host string | The same as the Default: |
login_password string | The same as the If not passed, relies on the driver’s default argument value. |
login_port integer | The same as the If not passed, relies on the driver’s default argument value. |
login_user string | The same as the If not passed, relies on the driver’s default argument value. Be sure your the user has permissions to read the system tables listed in the RETURN section. |
Attributes
Attribute | Support | Description |
|---|---|---|
check_mode | Support: full | Supports check_mode. |
Notes
Note
- See the clickhouse-driver documentation for more information about the driver interface.
Examples
- name: Get server information
register: result
community.clickhouse.clickhouse_info:
login_host: localhost
login_user: alice
login_db: foo
login_password: my_password
- name: Print returned data
ansible.builtin.debug:
var: result
- name: Limit return values with users and roles
register: result
community.clickhouse.clickhouse_info:
limit:
- users
- roles
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
clusters dictionary | The content of the system.clusters table with names as keys. Returned: success Sample: |
databases dictionary | The content of the system.databases table with names as keys. Be sure your login_user has permissions. Returned: success Sample: |
dictionaries dictionary added in community.clickhouse 0.3.0 | The content of the system.dictionaries table with dictionary names as keys. Returned: success Sample: |
driver dictionary | Python driver information. Returned: success Sample: |
grants dictionary added in community.clickhouse 0.7.0 | The content of the system.grants table for users and roles as keys. Returned: success Sample: |
merge_tree_settings dictionary added in community.clickhouse 0.3.0 | The content of the system.merge_tree_settings table with names as keys. Returned: success Sample: |
quotas dictionary added in community.clickhouse 0.4.0 | The content of the system.quotas table with quota names as keys. Returned: success Sample: |
roles dictionary | The content of the system.roles table with names as keys. Be sure your login_user has permissions. Returned: success Sample: |
settings dictionary | The content of the system.settings table with names as keys. Returned: success Sample: |
settings_profile_elements dictionary added in community.clickhouse 0.7.0 | The content of the system.settings_profile_elements table for users, roles, profiles as keys. Returned: success Sample: |
settings_profiles dictionary added in community.clickhouse 0.4.0 | The content of the system.settings_profiles table with profile names as keys. Returned: success Sample: |
storage_policies dictionary added in community.clickhouse 0.4.0 | The content of the system.storage_policies table with storage_policies names as keys. Returned: success Sample: |
tables dictionary added in community.clickhouse 0.3.0 | The content of the system.tables table with the table names as keys. Returned: success Sample: |
users dictionary | The content of the system.users table with names as keys. Be sure your login_user has permissions. Returned: success Sample: |
version dictionary | Clickhouse server version. Returned: success Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/community/clickhouse/clickhouse_info_module.html