community.clickhouse.clickhouse_info (0.4.0) — module

Gather ClickHouse server information using the clickhouse-driver Client interface

| "added in version" 0.1.0 of community.clickhouse"

Authors: Andrew Klychkov (@Andersson007), Aleksandr Vagachev (@aleksvagachev)

Install collection

Install with ansible-galaxy collection install community.clickhouse:==0.4.0


Add to requirements.yml

  collections:
    - name: community.clickhouse
      version: 0.4.0

Description

Gather ClickHouse server information using the L(clickhouse-driver,https://clickhouse-driver.readthedocs.io/en/latest) Client interface.

Does not change server state.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get server information
  register: result
  community.clickhouse.clickhouse_info:
    login_host: localhost
    login_user: alice
    login_db: foo
    login_password: my_password
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Print returned data
  ansible.builtin.debug:
    var: result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Limit return values with users and roles
  register: result
  community.clickhouse.clickhouse_info:
    limit:
      - users
      - roles

Inputs

    
limit:
    description:
    - 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.
    elements: str
    type: list
    version_added: 0.2.0
    version_added_collection: community.clickhouse

login_db:
    description:
    - The same as the C(Client(database='...')) argument.
    - If not passed, relies on the driver's default argument value.
    type: str

login_host:
    default: localhost
    description:
    - The same as the C(Client(host='...')) argument.
    type: str

login_port:
    description:
    - The same as the C(Client(port='...')) argument.
    - If not passed, relies on the driver's default argument value.
    type: int

login_user:
    description:
    - The same as the C(Client(user='...')) argument.
    - 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.
    type: str

client_kwargs:
    default: {}
    description:
    - Any additional keyword arguments you want to pass to the Client interface when instantiating
      its object.
    type: dict

login_password:
    description:
    - The same as the C(Client(password='...')) argument.
    - If not passed, relies on the driver's default argument value.
    type: str

Outputs

clusters:
  description:
  - The content of the system.clusters table with names as keys.
  returned: success
  sample:
    test_cluster_two_shards: '...'
  type: dict
databases:
  description:
  - The content of the system.databases table with names as keys.
  - Be sure your I(login_user) has permissions.
  returned: success
  sample:
    system: '...'
  type: dict
dictionaries:
  description:
  - The content of the system.dictionaries table with dictionary names as keys.
  returned: success
  sample:
    database:
      dictionary: '...'
  type: dict
  version_added: 0.3.0
  version_added_collection: community.clickhouse
driver:
  description: Python driver information.
  returned: success
  sample:
    version: 0.2.6
  type: dict
functions:
  description:
  - The content of the system.functions table with function names as keys.
  - Works only for clickhouse-server versions >= 22.
  - Does not output functions on the 'System' origin.
  returned: success
  sample:
    test_function: '...'
  type: dict
  version_added: 0.4.0
  version_added_collection: community.clickhouse
merge_tree_settings:
  description:
  - The content of the system.merge_tree_settings table with names as keys.
  returned: success
  sample:
    merge_max_block_size: '...'
  type: dict
  version_added: 0.3.0
  version_added_collection: community.clickhouse
quotas:
  description:
  - The content of the system.quotas table with quota names as keys.
  returned: success
  sample:
    default: '...'
  type: dict
  version_added: 0.4.0
  version_added_collection: community.clickhouse
roles:
  description:
  - The content of the system.roles table with names as keys.
  - Be sure your I(login_user) has permissions.
  returned: success
  sample:
    accountant: '...'
  type: dict
settings:
  description:
  - The content of the system.settings table with names as keys.
  returned: success
  sample:
    zstd_window_log_max: '...'
  type: dict
settings_profiles:
  description:
  - The content of the system.settings_profiles table with profile names as keys.
  returned: success
  sample:
    readonly: '...'
  type: dict
  version_added: 0.4.0
  version_added_collection: community.clickhouse
storage_policies:
  description:
  - The content of the system.storage_policies table with storage_policies names as
    keys.
  returned: success
  sample:
    storage_policies: '...'
  type: dict
  version_added: 0.4.0
  version_added_collection: community.clickhouse
tables:
  description:
  - The content of the system.tables table with the table names as keys.
  returned: success
  sample:
    system:
      settings: '...'
  type: dict
  version_added: 0.3.0
  version_added_collection: community.clickhouse
users:
  description:
  - The content of the system.users table with names as keys.
  - Be sure your I(login_user) has permissions.
  returned: success
  sample:
    default: '...'
  type: dict
version:
  description: Clickhouse server version.
  returned: success
  sample:
    build: 59
    feature: 12
    maintenance: 2
    raw: 23.12.2.59
    type: null
    year: 23
  type: dict