community.clickhouse.clickhouse_quota module – Creates or removes a ClickHouse quota
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_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_to list / elements=string | 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 |
apply_to_mode string | When When When Choices:
|
client_kwargs dictionary | Any additional keyword arguments you want to pass to the Client interface when instantiating its object. Default: |
cluster string | Run the command on all cluster hosts. If the cluster is not configured, the command will crash with an error. |
keyed_by string | Keys the quota by the specified key (default is to not key). Choices:
|
limits list / elements=dictionary | The limits that this quota should enforce. |
|
interval string / required |
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. |
|
max dictionary |
Maximum values to apply to this interval in this quota. At least one key must be specified. Mutually exclusive with |
|
errors integer |
Maximum number of errors to enforce in this interval. |
|
execution_time float |
Maximum number of execution time to enforce in this interval. |
|
failed_sequential_authentications integer |
Maximum number of failed sequential authentications to enforce in this interval. |
|
queries integer |
Maximum number of queries to enforce in this interval. |
|
query_inserts integer |
Maximum number of query inserts to enforce in this interval. |
|
query_selects integer |
Maximum number of query selects to enforce in this interval. |
|
read_bytes integer |
Maximum number of bytes read to enforce in this interval. |
|
read_rows integer |
Maximum number of rows read to enforce in this interval. |
|
result_bytes integer |
Maximum number of result bytes to enforce in this interval. |
|
result_rows integer |
Maximum number of result rows to enforce in this interval. |
|
written_bytes integer |
Maximum number of bytes written to enforce in this interval. |
|
no_limits boolean |
Don’t apply any limits. Mutually exclusive with Choices:
|
|
randomized_start boolean |
Whether this interval’s start should be randomized. Intervals always start at the same time if not randomized. Choices:
|
|
tracking_only boolean |
Just track usage instead of enforcing. Mutually exclusive with Choices:
|
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. |
name string / required | Quota name to add or remove. |
state string | Quota state.
Choices:
|
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: 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 |
|---|---|
executed_statements list / elements=string | Data-modifying executed statements. Returned: on 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_quota_module.html