Defined Type: tomcat::vhost

Defined in:
manifests/vhost.pp

Overview

Parameters:

  • vhostname (Any)
  • appbase (Any)
  • unpack_wars (Any) (defaults to: true)
  • autodeploy (Any) (defaults to: true)
  • servicename (Any) (defaults to: $name)
  • catalina_base (Any) (defaults to: "/opt/${name}")
  • tomcat_user (Any) (defaults to: $tomcat::params::default_tomcat_user)


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/vhost.pp', line 1

define tomcat::vhost(
                      $vhostname,
                      $appbase,
                      $unpack_wars   = true,
                      $autodeploy    = true,
                      $servicename   = $name,
                      $catalina_base = "/opt/${name}",
                      $tomcat_user   = $tomcat::params::default_tomcat_user,
                    ) {

  fail('TODO: not implemented')

  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
  }

  # <Host name="localhost"  appBase="webapps"
  #       unpackWARs="true" autoDeploy="true"

  fail('work in progress, do NOT use tomcat::vhost')

  concat { "${catalina_base}/conf/sites/${vhostname}.xml":
    ensure  => 'present',
    owner   => $tomcat_user,
    group   => $tomcat_user,
    mode    => '0644',
    require => File["${catalina_base}/conf/sites"],
    notify  => $serviceinstance,
  }

  concat::fragment{ "${catalina_base}/conf/sites/${vhostname}.xml end host":
    target  => "${catalina_base}/conf/sites/${vhostname}.xml",
    order   => '00',
    content => template("${module_name}/serverxml/vhost/00_host.erb"),
  }

  concat::fragment{ "${catalina_base}/conf/sites/${vhostname}.xml end host":
    target  => "${catalina_base}/conf/sites/${vhostname}.xml",
    order   => '99',
    content => "        </Host>\n",
  }

}