Puppet Class: tomcat::install

Defined in:
manifests/install.pp

Overview

Class: tomcat::install

install tomcat and logging stuff



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
# File 'manifests/install.pp', line 5

class tomcat::install {

  $package_name = $::osfamily ? {
    'redhat' => $::operatingsystemmajrelease ? {
      '7'     => 'tomcat',
      default => "tomcat${tomcat::version}",
    },
    'debian' => "tomcat${tomcat::version}",
  }

  $service_name = $::osfamily ? {
    'RedHat' => $::operatingsystemmajrelease ? {
      '7'     => 'tomcat',
      default => "tomcat${tomcat::version}",
    },
    'Debian' => "tomcat${tomcat::version}",
  }

  if !$tomcat::sources {
    package {'tomcat':
      ensure => present,
      name   => $package_name,
    }
    # Ensure default service is stopped
    -> service { 'tomcat':
      ensure => stopped,
      name   => $service_name,
      enable => false,
    }

    if $::osfamily != 'RedHat' or versioncmp($::operatingsystemmajrelease, '7') != 0 {
      if versioncmp($::tomcat::version, '9') < 0 {
        class {'::tomcat::juli':
          require => Package['tomcat'],
        }
      }

      class {'::tomcat::logging':
        require => Package['tomcat'],
      }

      if $::osfamily == 'RedHat' {
        class {'::tomcat::install::redhat': }
      }

      # Set the init script unexecutable
      file {"/etc/init.d/tomcat${tomcat::version}":
        ensure  => file,
        mode    => '0644',
        require => Service['tomcat'],
      }
    }

  } else {
    class {'::tomcat::source': }
  }
}