{"id":22845529,"url":"https://github.com/idealista/clickhouse_role","last_synced_at":"2025-10-26T22:39:06.645Z","repository":{"id":39327732,"uuid":"309657978","full_name":"idealista/clickhouse_role","owner":"idealista","description":"Ansible role to install Clickhouse","archived":false,"fork":false,"pushed_at":"2024-12-19T17:17:33.000Z","size":373,"stargazers_count":16,"open_issues_count":0,"forks_count":5,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-10-26T22:39:06.357Z","etag":null,"topics":["ansible","ansible-role","clickhouse","debian"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idealista.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-11-03T11:00:04.000Z","updated_at":"2025-08-22T11:48:57.000Z","dependencies_parsed_at":"2023-11-17T14:10:34.731Z","dependency_job_id":"a4c905f1-7bb3-4f42-b122-28cd617c9cf5","html_url":"https://github.com/idealista/clickhouse_role","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/idealista/clickhouse_role","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idealista%2Fclickhouse_role","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idealista%2Fclickhouse_role/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idealista%2Fclickhouse_role/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idealista%2Fclickhouse_role/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idealista","download_url":"https://codeload.github.com/idealista/clickhouse_role/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idealista%2Fclickhouse_role/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281185451,"owners_count":26457747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-role","clickhouse","debian"],"created_at":"2024-12-13T03:17:32.417Z","updated_at":"2025-10-26T22:39:06.603Z","avatar_url":"https://github.com/idealista.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clickhouse Ansible role\n\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/idealista/clickhouse_role?color=%23B62682)\n[![Build Status](https://travis-ci.org/idealista/clickhouse_role.png)](https://travis-ci.org/idealista/clickhouse_role) [![Ansible Galaxy](https://img.shields.io/badge/galaxy-idealista.clickhouse_role-B62682.svg)](https://galaxy.ansible.com/idealista/clickhouse_role)\n\n![Logo](https://raw.githubusercontent.com/idealista/clickhouse_role/main/logo.gif)\n\nThis ansible role installs [Clickhouse](https://clickhouse.com/) in a Debian environment. It has been tested for Debian bullseye.\n\nThis role has been generated using the [cookiecutter](https://github.com/cookiecutter/cookiecutter) tool, you can generate a similar role that fits your needs using the this [cookiecutter template](https://github.com/idealista/cookiecutter-ansible-role).\n\n- [Getting Started](#getting-started-checkered_flag)\n  - [Prerequisites](#prerequisites-ballot_box_with_check)\n  - [Installing](#Installing-inbox_tray )\n- [Usage](#usage-runner)\n- [Testing](#testing-test_tube)\n- [Built With](#built-with-building_construction)\n- [Versioning](#versioning-card_file_box)\n- [Authors](#authors-superhero)\n- [License](#license-spiral_notepad)\n- [Contributing](#contributing-construction_worker)\n\n## Getting Started :checkered_flag:\n\nThese instructions will get you a copy of the role for your Ansible playbook. Once launched, it will install [Clickhouse](https://clickhouse.com/) in a Debian system.\n\n### Prerequisites :ballot_box_with_check:\n\nAnsible 5.x.x version installed.\n\nMolecule 3.x.x version installed.\n\nFor testing purposes, [Molecule](https://molecule.readthedocs.io/) with [Docker](https://www.docker.com/) as driver and [Goss](https://github.com/aelsabbahy/goss) as verifier.\n\n### Installing :inbox_tray:\n\nCreate or add to your roles dependency file (e.g requirements.yml):\n\n```yml\n- src: idealista.clickhouse_role\n  scm: git\n  version: 3.2.0\n  name: clickhouse_role\n```\n\nInstall the role with ansible-galaxy command:\n\n```sh\nansible-galaxy install -p roles -r requirements.yml -f\n```\n\nUse in a playbook:\n\n```yml\n---\n- hosts: someserver\n  roles:\n    - role: clickhouse_role\n```\n\n## Usage :runner:\n\nLook to the [defaults](defaults/main.yml) properties file to see the possible configuration properties, it is very likely that you will not need to override any variables but don't forget to set your Admin user 🦸\n\n- [`main.yml`](./defaults/main.yml) for superset general purpose vars.\n\n### 👉 Don't forget\n\n- 🦸 To set your Admin user and use a secure 🔑 password.\n- 📝 To set the `clickhouse_custom_config_file_path` and / or `clickhouse_custom_users_file_path` if you are going to use custom config files.\n  - 👉 See the [ClickHouse doc](https://clickhouse.com/docs/en/operations/configuration-files/).\n- ☑️ To enable or disable using `clickhouse_role_manage_X` vars what things the role should manage.\n- 📝 To set users, quotas, profiles, grants, databases to create.\n  - ℹ️ Or to unset if you want to DROP things.\n  - 👉 See the default molecule scenario [`group_vars`](./molecule/default/group_vars/clickhouse_group.yml) for more\n\n### ❗ You must know\n\n- ❗ To make us of the 'EXCEPT' clauses for [quota assignation](https://clickhouse.com/docs/en/sql-reference/statements/create/quota/) or [user grantees](https://clickhouse.com/docs/en/sql-reference/statements/create/user/#grantees) for example, you can add a minus or dash _( - )_ before the name.\n- ❗ When setting `password_type` for users, it should be one of [this](https://clickhouse.com/docs/en/sql-reference/statements/create/user/#identification)\n- ❗ When setting `keyed` for quota, it should be one of [this](https://clickhouse.com/docs/en/sql-reference/statements/create/quota/)\n- ❗ In case you're using LDAP or Kerberos, set each with their own property `ldap_server` or 'kerberos' so `password_type` is not required\n- ⚠️ `clickhouse_replicated_tables_macros` is deprecated, please use `clickhouse_macros` var\n\n#### Users and roles\n\n- ⚠️ Note that are two ways to set users for ClickHouse, `users.xml` or via SQL-query, to distinguish both methods note that in this role we use `clickhouse_custom_users_xml` and `clickhouse_custom_users` respectively (SQL recommended).\n- ⚠️ When granting, you must know:\n  - When performing the GRANT actions to maintain the perms \u0026 privs clean a \"general\" REVOKE is performed before GRANTing\n  - There is an option to disable that before \"GRANTS\" clean up: `clickhouse_custom_grants_previous_cleanup`\n  - When granting permissions and privileges the order of the items in definition list takes precedence, is recommended to do this grant from less to the most restrictive.\n    - 👉 See example below, more at the default molecule scenario [`group_vars`](./molecule/default/group_vars/clickhouse_group.yml) for more.\n  - Statements Aliases are valid, but not handled at \"ansible level\" so this results in task making comparisions like `privileges: [DELETE]` vs `system.grants access_type = ALTER DELETE` (from ClickHouse), so we recommend set \"un-aliased\" perms and privs.\n  - When performing REVOKE or GRANT if a problem occurs may be result in unexpected / removed perms \u0026 privs in the ClickHouse DB ¡¡Be extra careful!!\n  - You can GRANT a role to a role, or roles to users with `clickhouse_custom_grant_roles`.\n\n##### Custom user definition example:\n\n  ```yml\n  clickhouse_custom_users:\n    - user:\n      name: \"Takumi\"\n      password_type: plaintext_password\n      password: \"AE86\"\n      networks:\n        - \"IP '::/0'\"\n      settings:\n        - \"max_memory_usage = 10000000000\"\n      role:\n        - projectd_members\n        - tofu_shop\n      profile:\n        - default\n      grantees:\n        - projectd_members\n      quota: \"default\"\n      databases: [ProjectD]\n      # ldap_server: project.d\n      # kerberos: \"\"\n\n  clickhouse_custom_grants:\n  - on:\n    databases: [Akina]\n    tables: [\"*\"]\n    privileges: [SELECT]\n    to: [initial_d]\n  - on:\n    # cluster:\n    databases: [\"Akina\"]\n    tables: [calendar, records]\n    # columns: [Notes]\n    privileges: [ALL]\n    to: [Takumi, Iketani]\n    with_grant_option: True\n  - on:\n    # cluster:\n    databases: [\"Akina\"]\n    tables: [records]\n    privileges: [SELECT, UPDATE]\n    to: [Iketani]\n    with_grant_option: False\n\n  clickhouse_custom_grant_roles:\n    - roles: [initial_d]\n      to: [Takumi, Iketani]\n      # cluster:\n```\n\n## Testing :test_tube:\n\n### Install dependencies\n\n```sh\npipenv install -r test-requirements.txt\n```\n\nFor more information read the [pipenv docs](ipenv-fork.readthedocs.io/en/latest/).\n\n### Testing\n\n```sh\n$ pipenv run molecule test\n```\n\n## Built With :building_construction:\n\n![Ansible](https://img.shields.io/badge/ansible-4.10.0-green.svg)\n![Molecule](https://img.shields.io/badge/molecule-3.5.2-green.svg)\n![Docker](https://img.shields.io/badge/docker-5.0.3-blue.svg)\n![Goss](https://img.shields.io/badge/goss-0.3.13-green.svg)\n\n## Versioning :card_file_box:\n\nFor the versions available, see the [tags on this repository](https://github.com/idealista/clickhouse_role/tags).\n\nAdditionaly you can see what change in each version in the [CHANGELOG.md](CHANGELOG.md) file.\n\n## Authors :superhero:\n\n- **Idealista** - _Work with_ - [idealista](https://github.com/idealista)\n\nSee also the list of [contributors](https://github.com/idealista/clickhouse_role/contributors) who participated in this project.\n\n## License :spiral_notepad:\n\n![Apache 2.0 License](https://img.shields.io/hexpm/l/plug.svg)\n\nThis project is licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license - see the [LICENSE](LICENSE) file for details.\n\n## Contributing :construction_worker:\n\nPlease read [CONTRIBUTING.md](.github/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidealista%2Fclickhouse_role","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidealista%2Fclickhouse_role","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidealista%2Fclickhouse_role/lists"}