Puppet Class: kafka_connect::install::archive

Defined in:
manifests/install/archive.pp

Summary

Manages the Kafka Connect archive (.tgz) based installation.

Overview



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'manifests/install/archive.pp', line 5

class kafka_connect::install::archive {
  assert_private()

  $tgz_file = regsubst($kafka_connect::archive_source, '^http.*(kafka.*.tgz)$', '\1')

  if $kafka_connect::owner {
    $_owner = $kafka_connect::owner
  } else {
    $_owner = $kafka_connect::user
  }

  file { $kafka_connect::archive_install_dir :
    ensure => 'directory',
    owner  => $_owner,
    group  => $kafka_connect::group,
    mode   => '0755',
    before => Archive["/tmp/${tgz_file}"],
  }

  archive { "/tmp/${tgz_file}":
    ensure          => 'present',
    extract         => true,
    extract_command => 'tar xfz %s --strip-components=1',
    extract_path    => $kafka_connect::archive_install_dir,
    creates         => "${kafka_connect::archive_install_dir}/bin",
    cleanup         => true,
    user            => $_owner,
    group           => $kafka_connect::group,
    source          => $kafka_connect::archive_source,
  }
}