Defined Type: tomcat::deploywar

Defined in:
manifests/deploywar.pp

Overview

puppet2sitepp @tomcatdepolywars

Parameters:

  • warname (Any)
  • source (Any)
  • catalina_base (Any) (defaults to: "/opt/${name}")
  • servicename (Any) (defaults to: $name)
  • app_base (Any) (defaults to: 'webapps')
  • add_root_ln (Any) (defaults to: false)
  • war_owner (Any) (defaults to: 'root')
  • war_group (Any) (defaults to: 'root')
  • war_mode (Any) (defaults to: '0644')


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

define tomcat::deploywar (
                            $warname,
                            $source,
                            $catalina_base = "/opt/${name}",
                            $servicename   = $name,
                            $app_base      = 'webapps',
                            $add_root_ln   = false,
                            $war_owner     = 'root',
                            $war_group     = 'root',
                            $war_mode      = '0644',
                          ) {

  if ! defined(Class['tomcat'])
  {
    fail('You must include the tomcat base class before using any tomcat defined resources')
  }

  if($servicename!=undef)
  {
    $serviceinstance=Tomcat::Instance::Service[$servicename]
  }
  else
  {
    $serviceinstance=undef
  }

  file { "${catalina_base}/${app_base}/${warname}.war":
    ensure  => 'present',
    owner   => $war_owner,
    group   => $war_group,
    mode    => $war_mode,
    require => File["${catalina_base}/${app_base}"],
    notify  => $serviceinstance,
    source  => $source,
  }

  if($add_root_ln)
  {
    file { "${catalina_base}/${app_base}/ROOT.war":
      ensure  => 'link',
      target  => "${catalina_base}/${app_base}/${warname}.war",
      require => File["${catalina_base}/${app_base}/${warname}.war"],
      notify  => $serviceinstance,
    }
  }
}