Puppet Class: maestro::maestro::package::tarball

Inherits:
maestro::params
Defined in:
manifests/maestro/package/tarball.pp

Overview

Parameters:

  • repo (Any)
  • version (Any)
  • base_version (Any)
  • srcdir (Any) (defaults to: $maestro::params::srcdir)
  • homedir (Any)
  • basedir (Any)


1
2
3
4
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'manifests/maestro/package/tarball.pp', line 1

class maestro::maestro::package::tarball(
  $repo,
  $version,
  $base_version,
  $srcdir = $maestro::params::srcdir,
  $homedir,
  $basedir) inherits maestro::params {

  $installdir = $maestro::maestro::installdir

  include wget

  wget::fetch { 'fetch-maestro':
    user        => $repo['username'],
    password    => $repo['password'],
    source      => "${repo['url']}/com/maestrodev/maestro/maestro-jetty/${base_version}/maestro-jetty-${version}-bin.tar.gz",
    destination => "${srcdir}/maestro-jetty-${version}-bin.tar.gz",
    require     => File[$srcdir],
  } ->
  exec {"rm -rf ${installdir}/maestro-${base_version}":
    unless => "egrep \"^${version}$\" $srcdir/maestro-jetty.version",
  } ->
  exec { 'unpack-maestro':
    command => "tar zxvf ${srcdir}/maestro-jetty-${version}-bin.tar.gz",
    creates => "${installdir}/maestro-${base_version}",
    cwd     => $installdir,
  } ->
  exec { "chown -R ${maestro::params::user} ${installdir}/maestro-${base_version}":
    require => User[$maestro::params::user],
  } ->
  file { "${installdir}/maestro-${base_version}/bin":
    mode    => '0755',
    recurse => true,
  } ->
  file { $homedir:
    ensure => link,
    target => "${installdir}/maestro-${base_version}"
  } ->
  file { "${srcdir}/maestro-jetty.version":
    content => "${version}\n",
  } ->
  # Touch the installation package even if current, so that it isn't deleted
  exec { "touch $srcdir/maestro-jetty-${version}-bin.tar.gz":
  } ->
  tidy { 'tidy-maestro':
    age     => '1d',
    matches => 'maestro-jetty-*',
    recurse => true,
    path    => $srcdir,
  }


}