Puppet Class: embulk

Defined in:
manifests/init.pp

Overview

Parameters:

  • ensure (String) (defaults to: latest)
  • user (String) (defaults to: 'root')


35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'manifests/init.pp', line 35

class embulk (
  String $ensure = latest,
  String $user   = 'root',
) {

  require ::java

  $url = $ensure ? {
    latest  => 'https://dl.embulk.org/embulk-latest.jar',
    present => 'https://dl.embulk.org/embulk-latest.jar',
    default => "https://dl.bintray.com/embulk/maven/embulk-${ensure}.jar",
  }

  $embulk_dir = $user ? {
    'root'  => '/root/.embulk',
    default => "/home/${user}/.embulk",
  }

  file {
    [
      $embulk_dir,
      "${embulk_dir}/bin",
    ]:
      ensure => 'directory',
      owner  => $user,
  }

  include ::wget
  ::wget::fetch { $url:
    destination => "${embulk_dir}/bin/embulk",
    user        => $user,
    verbose     => false,
  }
  ~> file { "${embulk_dir}/bin/embulk":
    ensure => present,
    owner  => $user,
    mode   => '0755',
  }

}