community.clickhouse.clickhouse_quota module – Creates or removes a ClickHouse quota
Note
This module is part of the community.clickhouse collection (version 2.0.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_quota.
New in community.clickhouse 1.1.0
Synopsis
Creates or removes a ClickHouse quota.
Requirements
The below requirements are needed on the host that executes this module.
clickhouse-driver
Parameters
Parameter |
Comments |
|---|---|
Apply this quota to the following list of users/roles dependent on Can include special keywords of default and current_user or the name of an actual user or role. Is an error to specify this if |
|
When When When Choices:
|
|
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. |
|
Keys the quota by the specified key (default is to not key). Choices:
|
|
The limits that this quota should enforce. |
|
The interval to apply the following quotas on. This is in the format Where unit is one of second, minute, hour, day, week, month, quarter or year. |
|
Maximum values to apply to this interval in this quota. At least one key must be specified. Mutually exclusive with |
|
Maximum number of errors to enforce in this interval. |
|
Maximum number of execution time to enforce in this interval. |
|
Maximum number of failed sequential authentications to enforce in this interval. |
|
Maximum number of queries to enforce in this interval. |
|
Maximum number of query inserts to enforce in this interval. |
|
Maximum number of query selects to enforce in this interval. |
|
Maximum number of bytes read to enforce in this interval. |
|
Maximum number of rows read to enforce in this interval. |
|
Maximum number of result bytes to enforce in this interval. |
|
Maximum number of result rows to enforce in this interval. |
|
Maximum number of bytes written to enforce in this interval. |
|
Don’t apply any limits. Mutually exclusive with Choices:
|
|
Whether this interval’s start should be randomized. Intervals always start at the same time if not randomized. Choices:
|
|
Just track usage instead of enforcing. Mutually exclusive with Choices:
|
|
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. |
|
Quota name to add or remove. |
|
Quota state.
Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Supports check_mode. |
Notes
Note
See the clickhouse-driver documentation for more information about the driver interface.
Examples
- name: Create quota
community.clickhouse.clickhouse_quota:
name: test_quota
state: present
- name: Create a quota with limits
community.clickhouse.clickhouse_quota:
name: test_quota
state: present
limits:
- interval: 5 minute
max:
queries: 100
execution_time: 100
apply_to:
- one_role
- another_role
cluster: test_cluster
- name: Remove quota
community.clickhouse.clickhouse_quota:
name: test_quota
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: |