Puppet Class: isp3node::jailkit::setup

Defined in:
manifests/jailkit/setup.pp

Summary

Install the current version of Jailkit on the host

Overview

Downloads the sourcecode archive, builds and installs the deb package

Examples:

include isp3node::jailkit::setup

Parameters:

  • build_packages (Array[String])

    Packages required to build the software

  • source (String)

    source url to download the file

  • file (String)

    Filename to download from the source

  • checksum (String)

    Expected checksum of the file

  • checksum_type (String)

    Hash type of the checksum

  • tmpfolder (String)

    Folder under /tmp/ that will be created by extracting the archive



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
54
55
56
57
58
59
60
61
62
63
64
65
# File 'manifests/jailkit/setup.pp', line 20

class isp3node::jailkit::setup(
  Array[String] $build_packages,
  String $source,
  String $file,
  String $checksum,
  String $checksum_type,
  String $tmpfolder,
) {
  unless($facts['isp3node']['jailkit']['installed']){
    package{$build_packages:
      ensure => latest,
      tag    => ['build-req'],
    }
    -> archive { $file:
      ensure        => present,
      path          => "/tmp/${file}",
      extract       => true,
      extract_path  => '/tmp',
      source        => "${source}/${file}",
      checksum      => $checksum,
      checksum_type => $checksum_type,
      creates       => "/tmp/${tmpfolder}",
      cleanup       => true,
    }
    -> file{"/tmp/${tmpfolder}/debian/comapat":
      ensure  => file,
      content => '5',
    }
    -> exec{'jailkit-build':
      command => 'rules binary && mv /tmp/jailkit_*.deb /tmp/jailkit.deb',
      path    => "${facts['path']}:/tmp/${tmpfolder}/debian",
      cwd     => "/tmp/${tmpfolder}",
      unless  => 'ls /tmp/jailkit.deb',
    }
    -> package{'jailkit':
      ensure   => installed,
      provider => 'dpkg',
      source   => '/tmp/jailkit.deb',
    }
    -> exec{'jailkit-cleanup':
      command => 'rm -rf /tmp/jailkit*',
      onlyif  => 'ls /tmp/jailkit*',
      path    => $facts['path'],
    }
  }
}