260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
|
# File 'manifests/init.pp', line 260
class kafka_connect (
# kafka_connect
Boolean $manage_connectors_only = false,
Boolean $manage_confluent_repo = true,
Boolean $manage_user_and_group = false,
Boolean $include_java = false,
# kafka_connect::confluent_repo
Enum['present', 'absent'] $repo_ensure = 'present',
Boolean $repo_enabled = true,
Pattern[/^(\d+\.\d+|\d+)$/] $repo_version = '7.7',
# kafka_connect::install
Enum['package', 'archive'] $install_source = 'package',
String[1] $package_name = 'confluent-kafka',
String[1] $package_ensure = '7.7.1-1',
Boolean $manage_schema_registry_package = true,
String[1] $schema_registry_package_name = 'confluent-schema-registry',
String[1] $confluent_rest_utils_package_name = 'confluent-rest-utils',
Stdlib::Absolutepath $confluent_hub_plugin_path = '/usr/share/confluent-hub-components',
Kafka_connect::HubPlugins $confluent_hub_plugins = [],
String[1] $confluent_hub_client_package_name = 'confluent-hub-client',
String[1] $confluent_common_package_name = 'confluent-common',
Stdlib::Absolutepath $archive_install_dir = '/opt/kafka',
Stdlib::HTTPUrl $archive_source = 'https://downloads.apache.org/kafka/3.8.0/kafka_2.13-3.8.0.tgz',
# kafka_connect::config
Enum['distributed', 'standalone'] $config_mode = 'distributed',
String[1] $kafka_heap_options = '-Xms256M -Xmx2G',
Stdlib::Absolutepath $kc_config_dir = '/etc/kafka',
Integer $config_storage_replication_factor = 1,
String[1] $config_storage_topic = 'connect-configs',
String[1] $group_id = 'connect-cluster',
Array[String[1]] $bootstrap_servers = ['localhost:9092'],
String[1] $key_converter = 'org.apache.kafka.connect.json.JsonConverter',
Boolean $key_converter_schemas_enable = true,
Stdlib::HTTPUrl $listeners = 'HTTP://:8083',
Kafka_connect::LogAppender $log4j_file_appender = 'RollingFileAppender',
Stdlib::Absolutepath $log4j_appender_file_path = '/var/log/confluent/connect.log',
String[1] $log4j_appender_max_file_size = '100MB',
Integer $log4j_appender_max_backup_index = 10,
String[1] $log4j_appender_date_pattern = '\'.\'yyyy-MM-dd-HH',
Boolean $log4j_enable_stdout = false,
Optional[Array[String[1]]] $log4j_custom_config_lines = undef,
Kafka_connect::Loglevel $log4j_loglevel_rootlogger = 'INFO',
String[1] $offset_storage_file_filename = '/tmp/connect.offsets',
Integer $offset_flush_interval_ms = 10000,
String[1] $offset_storage_topic = 'connect-offsets',
Integer $offset_storage_replication_factor = 1,
Integer $offset_storage_partitions = 25,
Stdlib::Absolutepath $plugin_path = '/usr/share/java,/usr/share/confluent-hub-components',
String[1] $status_storage_topic = 'connect-status',
Integer $status_storage_replication_factor = 1,
Integer $status_storage_partitions = 5,
String[1] $value_converter = 'org.apache.kafka.connect.json.JsonConverter',
Optional[Stdlib::HTTPUrl] $value_converter_schema_registry_url = undef,
Boolean $value_converter_schemas_enable = true,
Boolean $manage_systemd_service_file = true,
# kafka_connect::service
String[1] $service_name = 'confluent-kafka-connect',
Stdlib::Ensure::Service $service_ensure = 'running',
Boolean $service_enable = true,
Optional[String[1]] $service_provider = undef,
Boolean $run_local_kafka_broker_and_zk = false,
# kafka_connect::user
Variant[String[1], Integer] $user = 'cp-kafka-connect',
Variant[String[1], Integer] $group = 'confluent',
Enum['present', 'absent'] $user_and_group_ensure = 'present',
Optional[
Variant[String[1], Integer]
] $owner = undef, # deprecated, use $user
# kafka_connect::manage_connectors
Stdlib::Absolutepath $connector_config_dir = '/etc/kafka-connect',
Stdlib::Filemode $connector_config_file_mode = '0640',
Stdlib::Filemode $connector_secret_file_mode = '0600',
String[1] $hostname = 'localhost',
Stdlib::Port $rest_port = 8083,
Boolean $enable_delete = false,
Boolean $restart_on_failed_state = false,
) {
if $include_java {
include 'java'
}
if $owner {
deprecation('kafka_connect::owner',
'The $owner parameter is deprecated, please use $user instead.')
}
if $manage_connectors_only {
contain kafka_connect::manage_connectors
} else {
if $manage_confluent_repo {
contain kafka_connect::confluent_repo
Class['kafka_connect::confluent_repo']
-> Class['kafka_connect::install']
}
if $manage_user_and_group {
contain kafka_connect::user
Class['kafka_connect::user']
-> Class['kafka_connect::install']
}
contain kafka_connect::install
contain kafka_connect::config
contain kafka_connect::service
contain kafka_connect::manage_connectors
Class['kafka_connect::install']
-> Class['kafka_connect::config']
~> Class['kafka_connect::service']
-> Class['kafka_connect::manage_connectors']
}
}
|