community.clickhouse.clickhouse_role module – Creates or removes a ClickHouse role.
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_role.
New in community.clickhouse 0.5.0
Synopsis
- Creates or removes a ClickHouse role.
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: |
cluster string | Run the command on all cluster hosts. If the cluster is not configured, the command will crash with an error. |
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 | Role name to add or remove. |
settings list / elements=string | Settings with their limitations that apply to the role. You can also specify the profile from which the settings will be inherited. |
state string | Role 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 role
community.clickhouse.clickhouse_role:
name: test_role
state: present
- name: Create a role with settings
community.clickhouse.clickhouse_role:
name: test_role
state: present
settings:
- max_memory_usage = 15000 MIN 15000 MAX 16000 READONLY
- PROFILE restricted
cluster: test_cluster
- name: Remove role
community.clickhouse.clickhouse_role:
name: test_role
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_role_module.html