clickhouse
Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >= 7.0.0 < 9.0.0
- , , ,
Start using this module
Add this module to your Puppetfile:
mod 'deric-clickhouse', '3.1.0'
Learn more about managing modules with a PuppetfileDocumentation
Puppet Clickhouse
The clickhouse module installs, configures and manages the Clickhouse Server service.
It also allows to create and manage users, quotas, profiles, dictionaries, databases as well as configure replication and sharding.
Setup
Setup Requirements
This module requires xml-simple gem, which is used to translate Hash configuration to Clickhouse XML format configuration files. To install it you need to execute following command on your puppetmaster server:
sudo puppetserver gem install xml-simple
Beginning with clickhouse
To install a server with the default options:
include 'clickhouse::server'
.
To customize Clickhouse server options, you must also pass in an override hash:
class { 'clickhouse::server':
override_options => $override_options
}
See Customize Server Options below for examples of the hash structure for $override_options.
Usage
All server configuration is done via clickhouse::server
. To install client separatly, use clickhouse::client
Customize server options
To define server options, pass a hash structure of overrides in clickhouse::server
. Server configuration parameters can be found at https://clickhouse.yandex/docs/en/operations/server_settings/settings/
$override_options = {
parent_xml_tag => {
item => thing,
}
}
For example, to configure zstd compression pass following override options hash:
$override_options = {
compression => {
case => {
min_part_size => 10000000000,
min_part_size_ratio => 0.01,
method => 'zstd',
}
}
}
It will add following section to Clickhouse configuration file:
<compression>
<case>
<min_part_size>10000000000</min_part_size>
<min_part_size_ratio>0.01</min_part_size_ratio>
<method>zstd</method>
</case>
</compression>
Create a database
To create a database:
clickhouse_database { 'my_database':
ensure => 'present',
}
Specify passwords for users
In addition to passing passwords in plain text, you can input them in sha256 encoding. For example:
class { 'clickhouse::server':
users => {
myuser => {
password => '02472d6a1e23f73b37481bbd67949a5d16cbaf3d71770696f20a0cd773a2e682',
}
}
}
Install Clickhouse Server
This example shows how to install Clickhouse Server, configure zstd compression for it, create production profile and quota, create user alice and assign production profile and quota to her and also configure replication and three different sharding schemas: replicated - just a basic replication with single shard and two replicas; segmented - two shards without replicas; segmented_replicated - two shards each having two replicas:
class { 'clickhouse::server':
override_options => {
compression => {
case => {
min_part_size => 10000000000,
min_part_size_ratio => 0.01,
method => 'zstd',
},
},
},
profiles => {
production => {
use_uncompressed_cache => 0,
log_queries => 1,
max_memory_usage => ceiling($facts['memory']['system']['total_bytes'] * 0.7),
},
},
quotas => {
production => {
interval => [
{
duration => 3600,
queries => 200,
erros => 10,
result_rows => 0,
read_rows => 0,
execution_time => 0,
}
],
},
},
users => {
alice => {
password => '02472d6a1e23f73b37481bbd67949a5d16cbaf3d71770696f20a0cd773a2e682',
quota => 'production',
profile => 'production',
networks => {
ip => ['::/0'],
},
},
},
replication => {
zookeeper_servers => ['zookeeper1.local:2181', 'zookeeper2.local:2181', 'zookeeper3.local:2181'],
macros => {
cluster => 'Clickhouse_cluster',
replica => $facts['networking']['fqdn'],
},
},
remote_servers => {
replicated => {
shard => {
internal_replication => true,
replica => ['host1.local:9000', 'host2.local:9000'],
},
},
segmented => {
shard1 => {
weight => 1,
internal_replication => true,
replica => ['host1.local:9000'],
},
shard2 => {
weight => 2,
internal_replication => true,
replica => ['host2.local:9000'],
},
},
segmented_replicated => {
shard1 => {
internal_replication => true,
replica => ['host1.local:9000', 'host2.local:9000'],
},
shard2 => {
internal_replication => true,
replica => ['host3.local:9000', 'host4.local:9000'],
},
},
},
}
Hiera support
Configuration from YAML backend:
clickhouse::server::override_options:
listen_host: 0.0.0.0
default_profile: default
default_database: default
mark_cache_size: 5368709120
uncompressed_cache_size: 8589934592
path: /var/lib/clickhouse/
interserver_http_port: 9009
interserver_http_host: "%{::fqdn}"
max_connections: 4096
max_concurrent_queries: 100
http_port: 8123
tcp_port: 9000
prometheus:
endpoint: /metrics
port: 8001
metrics: true
events: true
asynchronous_metrics: true
clickhouse::server::profiles:
default:
max_memory_usage: 10000000000 # Maximum memory usage for processing single query, in bytes
use_uncompressed_cache: 0 # Use cache of uncompressed blocks of data. Meaningful only for processing many of very short queries
load_balancing: random
readonly:
readonly: 1
Replicas
Configure host properties:
clickhouse::server::remote_servers:
replicated:
shard:
internal_replication: true
replicas:
host1.local:
port: 9000
priority: 1
default_database: foo
tcp_port_secure: 9100
secure: 1
user: click
password: house
host2.local:
port: 9000
Crash reports
Settings for opt-in sending crash reports.
clickhouse::server::crash_reports:
enabled: true
endpoint: http://sentry.localhost # Overrides the Sentry endpoint
debug: false
Reference
Classes
Public Classes
clickhouse::client
: Installs and configures Clickhouse client.clickhouse::repo
: Installs repository for Clickhouse.clickhouse::server
: Installs and configures Clickhouse server.
Private Classes
clickhouse::client::install
: Private class for managing Clickhouse client package.clickhouse::params
: Private class for setting default Clickhouse parameters.clickhouse::server::config
: Private class for Clickhouse server configuration.clickhouse::server::install
: Private class for managing Clickhouse server package.clickhouse::server::resources
: Private class for applying Clickhouse resources.clickhouse::server::service
: Private class for managing the Clickhouse service.
Defined types
clickhouse::server::dictionary
: Create and manage Clickhouse dictionary.clickhouse::server::macros
: Create and manage Clickhouse macros file for replication.clickhouse::server::profiles
: Create and manage Clickhouse profiles.clickhouse::server::quotas
: Create and manage Clickhouse quotas.clickhouse::server::remote_servers
: Create and manage Clickhouse remote servers for Distributed engine.clickhouse::server::user
: Create and manage Clickhouse user.
Resource types
clickhouse_database
: Manages a Clickhouse database.
Functions
clickhouse_config
: Convert hash to Clickhouse XML config.
Limitations
For a list of supported operating systems, see metadata.json
Development
Please feel free to fork, modify, create issues, bug reports and pull requests.
Testing epp templates
Render template from CLI:
$ puppet epp render templates/zookeeper.xml.epp --values "{'zookeeper_servers' => ['172.0.0.1:2181'], distributed_ddl=> {path => '/foo' }}"
Reference
Table of Contents
Classes
Public Classes
clickhouse
: Installs and configures Clickhouseclickhouse::client
: Installs and configures Clickhouse client.clickhouse::repo
: Installs repository for Clickhouse.clickhouse::server
: Installs and configures Clickhouse server.
Private Classes
clickhouse::server::config
: Private class for Clickhouse server configuration.clickhouse::server::install
: Private class for managing Clickhouse server package.clickhouse::server::resources
: Private class for applying Clickhouse resources.clickhouse::server::service
: Private class for managing the Clickhouse service.
Defined types
clickhouse::server::dictionary
: Create and manage Clickhouse dictionary.clickhouse::server::macros
: Create and manage Clickhouse macros file for replication.clickhouse::server::profiles
: Create and manage Clickhouse profiles.clickhouse::server::quotas
: Create and manage Clickhouse quotas.clickhouse::server::remote_servers
: Create and manage Clickhouse remote servers for Distributed engine.clickhouse::server::user
: Create and manage Clickhouse user.
Resource types
clickhouse_database
: Manages a Clickhouse database.
Functions
clickhouse_config
: Convert hash to Clickhouse XML config.
Data types
Clickhouse::Clickhouse_crash_reports
: lint:ignore:2sp_soft_tabsClickhouse::Clickhouse_networks
: lint:ignore:2sp_soft_tabsClickhouse::Clickhouse_quotas
: lint:ignore:2sp_soft_tabsClickhouse::Clickhouse_remote_servers
: lint:ignore:2sp_soft_tabs, lint:ignore:140charsClickhouse::Clickhouse_replication
: lint:ignore:2sp_soft_tabsClickhouse::Clickhouse_users
: lint:ignore:2sp_soft_tabs
Classes
clickhouse
Installs and configures Clickhouse
Parameters
The following parameters are available in the clickhouse
class:
manage_repo
Data type: Boolean
Whether to install Clickhouse repository.
clickhouse::client
Installs and configures Clickhouse client.
Examples
Install Clickhouse client
class { 'clickhouse::client':
package_name => 'clickhouse-client',
package_ensure => 'present',
}
Parameters
The following parameters are available in the clickhouse::client
class:
package_name
Data type: String
Name of Clickhouse client package to install. Defaults to 'clickhouse-client'.
package_ensure
Data type: String
Whether the Clickhouse client package should be present, absent or specific version. Valid values are 'present', 'absent' or 'x.y.z'. Defaults to 'present'.
manage_package
Data type: Boolean
Whether to manage Clickhouse client package. Defaults to 'true'.
package_install_options
Data type: Array[String]
Array of install options for managed package resources. Appropriate options are passed to package manager.
clickhouse::repo
Installs repository for Clickhouse.
Examples
include clickhouse::repo
clickhouse::server
Installs and configures Clickhouse server.
Examples
Install Clickhouse Server.
class { 'clickhouse::server':
package_name => 'clickhouse-server',
package_ensure => '19.1.6-1.el7',
}
Parameters
The following parameters are available in the clickhouse::server
class:
package_name
package_ensure
manage_package
package_install_options
manage_config
config_dir
datadir_mode
confdir_mode
users_dir
dict_dir
clickhouse_datadir
clickhouse_tmpdir
clickhouse_user
clickhouse_group
keep_default_users
override_options
config_file
profiles_file
quotas_file
macros_file
zookeeper_config_file
remote_servers_file
dict_source_folder
install_client
service_name
service_ensure
service_enabled
manage_service
restart
users
profiles
quotas
dictionaries
replication
remote_servers
crash_reports
main_dir
manage_systemd
package_name
Data type: String
Name of Clickhouse Server package to install. Defaults to 'clickhouse-server'.
package_ensure
Data type: String
Whether the Clickhouse Server package should be present, absent or specific version. Valid values are 'present', 'absent' or 'x.y.z'. Defaults to 'present'.
manage_package
Data type: Boolean
Whether to manage Clickhouse Server package. Defaults to 'true'.
package_install_options
Data type: Array[String]
Array of install options for managed package resources. Appropriate options are passed to package manager.
manage_config
Data type: Boolean
Whether the Clickhouse Server configurations files should be managd. Defaults to 'true'.
config_dir
Data type: Stdlib::Unixpath
Directory where Clickhouse Server configuration files will be stored. Defaults to '/etc/clickhouse-server/conf.d'.
datadir_mode
Data type: String
Permissions for data directory
confdir_mode
Data type: String
Permissions for config directory
users_dir
Data type: Stdlib::Unixpath
Directory where Clickhouse Server user configuration files will be stored. Defaults to '/etc/clickhouse-server/users.d'.
dict_dir
Data type: Stdlib::Unixpath
Directory where Clickhouse Server dictionaries will be stored. Defaults to '/etc/clickhouse-server/dict'.
clickhouse_datadir
Data type: Stdlib::Unixpath
Directory where Clickhouse Server database files will be stored. Defaults to '/var/lib/clickhouse/'.
clickhouse_tmpdir
Data type: Stdlib::Unixpath
Directory where Clickhouse Server tmp files will be stored. Defaults to '/var/lib/clickhouse/tmp/'.
clickhouse_user
Data type: String
Owner for Clickhouse Server configuration and data directories. Defaults to 'clickhouse'.
clickhouse_group
Data type: String
Group for Clickhouse Server configuration and data directories. Defaults to 'clickhouse'.
keep_default_users
Data type: Boolean
Specifies whether to automatically remove default users, which are specified in users.xml file. Defaults to 'false'.
override_options
Data type: Hash[String, Any]
Hash[String, Any] of override options to pass to Clickhouse Server configuration file.
Default value: {}
config_file
Data type: String
Name of the file, where Clickhouse Server configuration will be stored. See https://clickhouse.yandex/docs/en/operations/configuration_files/. Defaults to 'config.xml'
profiles_file
Data type: String
Name of the file, where Clickhouse Server profiles configuration will be stored. See https://clickhouse.yandex/docs/en/operations/settings/settings_profiles/. Defaults to '$profiles.xml'.
quotas_file
Data type: String
Name of the file, where Clickhouse Server quotas configuration will be stored. See https://clickhouse.yandex/docs/en/operations/quotas/. Defaults to 'quotas.xml'.
macros_file
Data type: String
Name of the file, where Clickhouse Server macros configuration for replication will be stored. See https://clickhouse.yandex/docs/en/operations/table_engines/replication/. Defaults to '$macros.xml'.
zookeeper_config_file
Data type: String
Name of the file, where Clickhouse Server zookeeper configuration will be stored. See https://clickhouse.yandex/docs/en/operations/table_engines/replication/. Defaults to 'zookeeper.xml'.
remote_servers_file
Data type: String
Name of the file, where Clickhouse Server remote servers configuration for Distributed table engine will be stored. See https://clickhouse.yandex/docs/en/operations/table_engines/distributed/. Defaults to 'remote_servers.xml'.
dict_source_folder
Data type: String
Path to a 'files' folder in puppet, where dictionary file are located. Defaults to 'puppet:///modules/${module_name}'.
Default value: "puppet:///modules/${module_name}"
install_client
Data type: Boolean
Specifies whether to install Clickhouse Client package. Defaults to 'true'.
service_name
Data type: String
Name of the Clickhouse Server service. Defaults to 'clickhouse-server'.
service_ensure
Data type: Stdlib::Ensure::Service
Specifies whether Clickhouse Server service should be running. Defaults to 'running'.
service_enabled
Data type: Boolean
Specifies whether Clickhouse Server service should be enabled. Defaults to 'true'.
manage_service
Data type: Boolean
Specifies whether Clickhouse Server service should be managed. Defaults to 'true'.
restart
Data type: Boolean
Specifies whether Clickhouse Server service should be restated when configuration changes. Defaults to 'false'.
users
Data type: Optional[Clickhouse::Clickhouse_users]
Users, which are passed to clickhouse::server::user (see types/clickhouse_users.pp for data type description). See https://clickhouse.yandex/docs/en/operations/access_rights/.
Default value: undef
profiles
Data type: Optional[Hash[String, Hash[String, Any]]]
Profiles configuration, which are passed to clickhouse::server::profiles. See https://clickhouse.yandex/docs/en/operations/settings/settings_profiles/.
Default value: undef
quotas
Data type: Optional[Clickhouse::Clickhouse_quotas]
Quotas configuration, which are passed to clickhouse::server::quotas. See https://clickhouse.yandex/docs/en/operations/quotas/.
Default value: undef
dictionaries
Data type: Optional[Array[String]]
Dictionaries configuration, which are passed to clickhouse::server::dictionary. See https://clickhouse.yandex/docs/en/query_language/dicts/external_dicts/.
Default value: undef
replication
Data type: Optional[Clickhouse::Clickhouse_replication]
Replication configuration parameters (see types/clickhouse_replication.pp for data type description). See https://clickhouse.yandex/docs/en/operations/table_engines/replication/.
Default value: undef
remote_servers
Data type: Optional[Clickhouse::Clickhouse_remote_servers]
Remote server configuration parameters for Distributed engine (see types/clickhouse_remote_servers.pp for data type description), which are passed to clickhouse::server::remote_servers. See https://clickhouse.yandex/docs/en/operations/table_engines/distributed/.
Default value: undef
crash_reports
Data type: Optional[Clickhouse::Clickhouse_crash_reports]
Default value: undef
main_dir
Data type: Stdlib::Unixpath
manage_systemd
Data type: Boolean
Defined types
clickhouse::server::dictionary
Create and manage Clickhouse dictionary.
Examples
Create a basic Clickhouse dictionary:
clickhouse::server::dictionary { 'countries.xml':
source => 'puppet:///modules/clickhouse/dictionaries',
}
Parameters
The following parameters are available in the clickhouse::server::dictionary
defined type:
name
Name of the dictionary file in the $source and $dict_dir folders.
dict_dir
Data type: Stdlib::Unixpath
Path to folder with clickhouse dictionaries. Defaults to '/etc/clickhouse-server/dict'.
Default value: $clickhouse::server::dict_dir
dict_file_owner
Data type: String
Owner of the dictionary file. Defaults to 'clickhouse'.
Default value: $clickhouse::server::clickhouse_user
dict_file_group
Data type: String
Group of the dictionary file. Defaults to 'clickhouse'.
Default value: $clickhouse::server::clickhouse_group
ensure
Data type: Enum['present', 'absent']
Specifies whether to create dictionary. Valid values are 'present', 'absent'. Defaults to 'present'.
Default value: 'present'
source
Data type: String
Path to a 'files' folder in puppet, where dictionary file are located. Defaults to 'puppet:///modules/${module_name}'.
Default value: "${clickhouse::server::dict_source_folder}/${title}"
clickhouse::server::macros
Create and manage Clickhouse macros file for replication.
Examples
Create macros file /etc/clickhouse-server/conf.d/macros.xml with substitutions for cluster, replica and shard
clickhouse::server::macros { 'macros.xml':
config_folder => '/etc/clickhouse-server/conf.d',
macros => {
cluster => 'Clickhouse_cluster',
replica => 'myhost.local',
shard => '1',
},
}
Parameters
The following parameters are available in the clickhouse::server::macros
defined type:
name
Name of the file with macros configurations.
config_dir
Data type: Stdlib::Unixpath
Path to Clickhouse configuration folder. Defaults to '/etc/clickhouse-server/conf.d'.
Default value: $clickhouse::server::config_dir
macros_file_owner
Data type: String
Owner of the macros file. Defaults to 'clickhouse'.
Default value: $clickhouse::server::clickhouse_user
macros_file_group
Data type: String
Group of the macros file. Defaults to 'clickhouse'.
Default value: $clickhouse::server::clickhouse_group
ensure
Data type: Enum['present', 'absent']
Specifies whether to create macros file. Valid values are 'present', 'absent'. Defaults to 'present'.
Default value: 'present'
macros
Data type: Hash[String, Any]
Substitions in macros file.
Default value: {}
clickhouse::server::profiles
Create and manage Clickhouse profiles.
Examples
Create two profiles (web and readonly), which will be stored in /etc/clickhouse-server/users.d/profiles.xml file.
clickhouse::server::profiles { 'profiles.xml':
config_dir => '/etc/clickhouse-server/users.d',
profiles => {
web => {
max_threads => 8,
max_rows_to_read => 1000000000,
},
readonly => {
readonly => 1,
},
},
}
Parameters
The following parameters are available in the clickhouse::server::profiles
defined type:
name
Name of the file with profiles configurations.
config_dir
Data type: Stdlib::Unixpath
Path to Clickhouse configuration folder. Defaults to '/etc/clickhouse-server/conf.d'.
Default value: $clickhouse::server::config_dir
profiles_file_owner
Data type: String
Owner of the profiles file. Defaults to 'clickhouse'.
Default value: $clickhouse::server::clickhouse_user
profiles_file_group
Data type: String
Group of the profiles file. Defaults to 'clickhouse'.
Default value: $clickhouse::server::clickhouse_group
ensure
Data type: Enum['present', 'absent']
Specifies whether to create profiles file. Valid values are 'present', 'absent'. Defaults to 'present'.
Default value: 'present'
profiles
Data type: Hash[String, Hash[String, Any]]
Profiles configuration.
Default value: {}
clickhouse::server::quotas
Create and manage Clickhouse quotas.
Examples
Create two quotas (web with two intervals, office with one).
clickhouse::server::quotas { 'quotas.xml':
config_dir => '/etc/clickhouse-server/users.d',
quotas => {
web => {
interval => [
{
duration => 3600,
queries => 2,
errors => 5,
result_rows => 1000,
read_rows => 1000,
execution_time => 5000,
},
{
duration => 86400,
queries => 2000,
errors => 50,
result_rows => 10000,
read_rows => 10000,
execution_time => 50000,
},
],
},
office => {
interval => [
{
duration => 3600,
queries => 256,
errors => 50,
result_rows => 3000,
read_rows => 3000,
execution_time => 5000,
}
],
},
},
}
Parameters
The following parameters are available in the clickhouse::server::quotas
defined type:
name
Name of the file with quotas configurations.
users_dir
Data type: Stdlib::Unixpath
Path to Clickhouse configuration folder. Defaults to '/etc/clickhouse-server/users.d'.
Default value: $clickhouse::server::config_dir
quotas_file_owner
Data type: String
Owner of the quotas file. Defaults to 'clickhouse'.
Default value: $clickhouse::server::clickhouse_user
quotas_file_group
Data type: String
Group of the quotas file. Defaults to 'clickhouse'.
Default value: $clickhouse::server::clickhouse_group
ensure
Data type: Enum['present', 'absent']
Specifies whether to create quotas file. Valid values are 'present', 'absent'. Defaults to 'present'.
Default value: 'present'
quotas
Data type: Clickhouse::Clickhouse_quotas
Quotas configuraion.
Default value: {}
clickhouse::server::remote_servers
Create and manage Clickhouse remote servers for Distributed engine.
Examples
Create three Clickhouse clusters. Replicated - one shard with two replicas, segmented - two shards without replicas, segmented_replicated - two shards, each having two replicas.
clickhouse::server::remote_servers { 'remote_servers.xml':
remote_servers_file => '/etc/clickhouse-server/conf.d',
remote_servers => {
replicated => {
shard => {
weight => 1,
internal_replication => true,
replica => ['host1.local:9000', 'host2.local:9000'],
}
},
segmented => {
shard1 => {
internal_replication => true,
replica => ['host1.local:9000'],
},
shard2 => {
internal_replication => true,
replica => ['host2.local:9000'],
}
},
segmented_replicated => {
shard1 => {
internal_replication => true,
replica => ['host1.local:9000', 'host2.local:9000'],
},
shard2 => {
internal_replication => true,
replica => ['host3.local:9000', 'host4.local:9000'],
}
},
},
}
Parameters
The following parameters are available in the clickhouse::server::remote_servers
defined type:
name
Name of the file with remote servers configurations.
config_dir
Data type: Stdlib::Unixpath
Path to Clickhouse configuration folder. Defaults to '/etc/clickhouse-server/conf.d'.
Default value: $clickhouse::server::config_dir
remote_servers_file_owner
Data type: String
Owner of the remote servers file. Defaults to 'clickhouse'.
Default value: $clickhouse::server::clickhouse_user
remote_servers_file_group
Data type: String
Group of the remote servers file. Defaults to 'clickhouse'.
Default value: $clickhouse::server::clickhouse_group
ensure
Data type: Enum['present', 'absent']
Specifies whether to create remote servers file. Valid values are 'present', 'absent'. Defaults to 'present'.
Default value: 'present'
remote_servers
Data type: Clickhouse::Clickhouse_remote_servers
Remote server configurations (see types/clickhouse_remote_servers.pp for data type description).
Default value: {}
clickhouse::server::user
Create and manage Clickhouse user.
Examples
Create Clickhouse user.
clickhouse::server::user { 'alice':
password => 'HelloAlice',
quota => 'default',
profile => 'default',
allow_databases => ['web', 'data'],
networks => {
ip => ['::/0'],
},
}
Parameters
The following parameters are available in the clickhouse::server::user
defined type:
name
password
quota
profile
allow_databases
networks
access_management
grants
users_dir
user_file_owner
user_file_group
ensure
name
Name of the Clickhouse user. Will be also used as a file name for user configuration file in $users_dir folder.
password
Data type: Optional[String]
Password for Clickhouse user. Can be specified in plaintext (and later hashed using sha256) or in sha256 format.
Default value: undef
quota
Data type: String
Name of the quota for user.
Default value: 'default'
profile
Data type: String
Name of the profile for user.
Default value: 'default'
allow_databases
Data type: Optional[Array[String]]
Array of databases, the user will have permissions to access.
Default value: undef
networks
Data type: Optional[Clickhouse::Clickhouse_networks]
Clickhouse::Clickhouse_networks (see types/clickhouse_networks.pp) Restrictions for ip\hosts for user.
Default value: undef
access_management
Data type: Optional[Integer[0,1]]
This setting enables or disables using of SQL-driven access control and account management for the user.
Default value: undef
grants
Data type: Optional[Array[String]]
This setting allows to grant any rights to selected user. Each element of the list should be GRANT query without any grantees specified.
Default value: undef
users_dir
Data type: Stdlib::Unixpath
Path to directory, where user configuration will be stored. Defaults to '/etc/clickhouse-server/conf.d/'
Default value: $clickhouse::server::config_dir
user_file_owner
Data type: String
Owner of the user file. Defaults to 'clickhouse'.
Default value: $clickhouse::server::clickhouse_user
user_file_group
Data type: String
Group of the user file. Defaults to 'clickhouse'.
Default value: $clickhouse::server::clickhouse_group
ensure
Data type: Enum['present', 'absent']
Specifies whether to create user. Valid values are 'present', 'absent'. Defaults to 'present'.
Default value: 'present'
Resource types
clickhouse_database
Manages a Clickhouse database.
Properties
The following properties are available in the clickhouse_database
type.
ensure
Valid values: present
, absent
The basic property that the resource should be in.
Default value: present
Parameters
The following parameters are available in the clickhouse_database
type.
name
namevar
The name of the Clickhouse database to manage.
provider
The specific backend to use for this clickhouse_database
resource. You will seldom need to specify this --- Puppet
will usually discover the appropriate provider for your platform.
Functions
clickhouse_config
Type: Ruby 3.x API
Convert hash to Clickhouse XML config.
clickhouse_config(Hash $Settings)
The clickhouse_config function.
Returns: Xml
Сlickhouse XML configuration.
Settings
Data type: Hash
for Clickhouse Server.
Data types
Clickhouse::Clickhouse_crash_reports
lint:ignore:2sp_soft_tabs
Alias of
Struct[{enabled => Boolean,
Optional[endpoint] => String,
Optional[anonymize] => Boolean,
Optional[http_proxy] => String,
Optional[debug] => Boolean,
Optional[tmp_path] => String
}]
Clickhouse::Clickhouse_networks
lint:ignore:2sp_soft_tabs
Alias of
Struct[{Optional[ip] => Array[String],
Optional[host] => Array[String],
Optional[host_regexp] => Array[String]}]
Clickhouse::Clickhouse_quotas
lint:ignore:2sp_soft_tabs
Alias of
Hash[String, Struct[{interval => Array[Struct[{Optional[duration] => Integer,
Optional[queries] => Integer,
Optional[errors] => Integer,
Optional[result_rows] => Integer,
Optional[read_rows] => Integer,
Optional[execution_time] => Integer}]]}]]
Clickhouse::Clickhouse_remote_servers
lint:ignore:2sp_soft_tabs, lint:ignore:140chars
Alias of
Hash[String, Hash[
String,Struct[{
Optional[weight] => Integer,
Optional[internal_replication] => Boolean,
Optional[replication_user] => String,
Optional[replication_password] => String,
Optional[replica] => Array[Pattern['[^\:]+:[0-9]{1,5}']],
Optional[replicas] => Hash[
String, Struct[{
Optional[port] => Integer,
Optional[priority] => Integer,
Optional[secure] => Integer,
Optional[default_database] => String,
Optional[tcp_port_secure] => Integer,
Optional[user] => String,
Optional[password] => String,
}]
]
}]
]]
Clickhouse::Clickhouse_replication
lint:ignore:2sp_soft_tabs
Alias of
Struct[{zookeeper_servers => Array[Pattern['[^\:]+:[0-9]{1,5}']],
Optional[secure] => Boolean,
Optional[macros] => Hash[String, Any],
Optional[distributed_ddl] => Struct[{
Optional[path] => String,
Optional[profile] => String,
}]
}]
Clickhouse::Clickhouse_users
lint:ignore:2sp_soft_tabs
Alias of
Hash[String, Struct[{Optional[password] => String,
Optional[quota] => String,
Optional[profile] => String,
Optional[allow_databases] => Array[String],
Optional[networks] => Clickhouse::Clickhouse_networks,
Optional[users_dir] => Stdlib::Unixpath,
Optional[user_file_owner] => String,
Optional[user_file_group] => String,
Optional[ensure] => String}], 1]
Changelog
All notable changes to this project will be documented in this file.
Release 3.1.0 [2024-10-14]
- feat(users): add options for user management (#3)
Release 3.0.0 [2024-09-03]
- BC: replace
clickhouse::params
class by Hiera - BC:
clickhouse::server::manage_repo
renamed toclickhouse::manage_repo
- Feat: switch to modern apt GPG keyrings
- Feat: Manage
clickhouse-common-static
package and its version (allow downgrades/upgrades to specific version) - BC: removed
clickhouse::server::client_*
parameters, all are remain available viaclickhouse::client::*
namespace - Remove support for old systems
- Ensure correct resources ordering
Release 2.1.0 [2024-06-28]
- Feat: add secure option to use ssl on keeper communications
- Fix: declare client variables on server to be passed on client class instantiation
- Fix: invalid yaml data
Release 2.0.0 [2024-02-14]
- Support Puppet 8
- puppetlabs/stdlib 9
- puppetlabs/apt 9
- Removed anchors, using contain instead
- Use official RPM repo
Release 1.2.0
- Switched apt to packages.clickhouse.com
Bugfixes
- Fixed apt dependency cycle
Release 1.1.0
Dependencies
- puppetlabs-stdlib (>= 6.6.0 < 10.0.0)
- puppetlabs-apt (>= 9.2.0 < 10.0.0)
- puppetlabs-yumrepo_core (>= 1.0.0 < 3.0.0)