Puppet Class: monitoring::install

Defined in:
manifests/install.pp

Overview



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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'manifests/install.pp', line 2

class monitoring::install {
  # some useful perl modules to install

  package { 'perl-Authen-SASL':
    name   => $::operatingsystem ? {
      /(CentOS|Redhat|Fedora)/ => 'perl-Authen-SASL',
      /(Debian|Ubuntu)/        => 'libauthen-sasl-perl'
    },
    ensure => installed,
  }

  package { 'perl-Mail-Sender':
    name   => $::operatingsystem ? {
      /(CentOS|Redhat|Fedora)/ => 'perl-Mail-Sender',
      /(Debian|Ubuntu)/        => 'libmail-sender-perl'
    },
    ensure => installed,
  }

  package { 'perl-Mail-IMAPClient':
    name   => $::operatingsystem ? {
      /(CentOS|Redhat|Fedora)/ => 'perl-Mail-IMAPClient',
      /(Debian|Ubuntu)/        => 'libmail-imapclient-perl'
    },
    ensure => installed,
  }

  package { 'perl-YAML':
    name   => $::operatingsystem ? {
      /(CentOS|Redhat|Fedora)/ => 'perl-YAML',
      /(Debian|Ubuntu)/        => 'libyaml-perl'
    },
    ensure => installed,
  }

  package { 'libwww-perl':
    name   => $::operatingsystem ? {
      /(Debian|Ubuntu)/        => 'libwww-perl',
      /(CentOS|Redhat|Fedora)/ => 'perl-libwww-perl'
    },
    ensure => installed,
  }

  case $::operatingsystem {
    Fedora         : {
      package { 'perl-LWP-Protocol-https':
        ensure => installed,
      }
    }
    Debian, Ubuntu : {
      package { 'liblwp-protocol-https-perl':
        ensure => installed,
      }
    }
    CentOS, RedHat : {
      if ($::operatingsystemmajrelease >= 7) {
        package { 'perl-LWP-Protocol-https':
          ensure => installed,
        }
      } else {
        exec { 'install LWP::Protocol::https via cpan':
          command => "perl -MCPAN -e '\$ENV{PERL_MM_USE_DEFAULT}=1; CPAN::Shell->install(\"LWP::Protocol::https\")'",
          onlyif  => "test `/usr/bin/perl -MLWP::Protocol::https -e 'print 1' 2>/dev/null || echo 0` == '0'",
          require => Package['libwww-perl'],
        }
      }
    }
    default        : {
      exec { 'install LWP::Protocol::https via cpan':
        command => "perl -MCPAN -e '\$ENV{PERL_MM_USE_DEFAULT}=1; CPAN::Shell->install(\"LWP::Protocol::https\")'",
        onlyif  => "test `/usr/bin/perl -MLWP::Protocol::https -e 'print 1' 2>/dev/null || echo 0` == '0'",
        require => Package['libwww-perl'],
      }
    }
  }

  package { 'perl-Crypt-SSLeay':
    name   => $::operatingsystem ? {
      /(Debian|Ubuntu)/        => 'libcrypt-ssleay-perl',
      /(CentOS|Redhat|Fedora)/ => 'perl-Crypt-SSLeay'
    },
    ensure => installed,
  }

}