community.clickhouse.clickhouse_named_collection module – Creates, removes or modify a ClickHouse named collection using the clickhouse-driver Client interface
Note
This module is part of the community.clickhouse collection (version 2.2.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_named_collection.
New in community.clickhouse 2.2.0
Synopsis
Creates, remove or modify a ClickHouse named collection using the clickhouse-driver Client interface.
The module can only work if
login_userwill have necessary grants.An existing named collection can be modified only if server is properly configured and user is allowed to view secrets. There is an option to rewrite whole secret, but then it will not be idempotent.
Module is supported only on version 25.8 or later.
Requirements
The below requirements are needed on the host that executes this module.
clickhouse-driver
Parameters
Parameter |
Comments |
|---|---|
Any additional keyword arguments you want to pass to the Client interface when instantiating its object. Default: |
|
Run the command on all cluster hosts. If the cluster is not configured, the command will crash with an error. |
|
Content of named collection. |
|
Name of secret. |
|
Content of secret. |
|
The same as the If not passed, relies on the driver’s default argument value. |
|
The same as the Default: |
|
The same as the If not passed, relies on the driver’s default argument value. |
|
The same as the If not passed, relies on the driver’s default argument value. |
|
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. |
|
Named collection name to add or remove. |
|
Force to rewrite secret. It has only use when viewing secrets is disabled and user can’t fetch secrets values. If user can view secret values it will be fully idempotent. Will only alter collection if it differs. Choices:
|
|
Named collection state. If If Choices:
|
|
List of server error codes that will be treated as success, otherwise throw errors. Default: |
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Supports check_mode. |
|
Support: full |
At second run will not change anything. If
|
Notes
Note
See the clickhouse-driver documentation for more information about the driver interface.
Examples
- name: Create named collection with 2 secrets
community.clickhouse.clickhouse_named_collection:
name: test_col
collection:
- name: user
value: alice
- name: password
value: test_pass
- name: Create named collection with forcing rewrite
community.clickhouse.clickhouse_named_collection:
name: test_col
collection:
- name: user
value: alice
- name: password
value: test_pass
rewrite: true
- name: Drop named collection
community.clickhouse.clickhouse_named_collection:
name: test_col
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Data-modifying executed statements. Returned: on success Sample: |
|
Query parameters passed to query from executed_statements. Returned: on succes Sample: |