Defined Type: tomcat::jaas

Defined in:
manifests/jaas.pp

Overview

88 88

 ""                       88
                          88
 88 ,adPPYYba,  ,adPPYba, 88   ,d8  ,adPPYYba, ,adPPYba, ,adPPYba,
 88 ""     `Y8 a8"     "" 88 ,a8"   ""     `Y8 I8[    "" I8[    ""
 88 ,adPPPPP88 8b         8888[     ,adPPPPP88  `"Y8ba,   `"Y8ba,
 88 88,    ,88 "8a,   ,aa 88`"Yba,  88,    ,88 aa    ]8I aa    ]8I
 88 `"8bbdP"Y8  `"Ybbd8"' 88   `Y8a `"8bbdP"Y8 `"YbbdP"' `"YbbdP"'
,88

888P“

puppet2sitepp @jaasproperties

Parameters:

  • app (Any) (defaults to: undef)
  • provider (Any) (defaults to: undef)
  • filter (Any) (defaults to: undef)
  • username (Any) (defaults to: 'tomcat')
  • password (Any) (defaults to: 'tomcat')
  • realm (Any) (defaults to: undef)
  • spn (Any) (defaults to: undef)
  • debug (Any) (defaults to: false)
  • servicename (Any) (defaults to: $name)
  • catalina_base (Any) (defaults to: "/opt/${name}")
  • ensure (Any) (defaults to: 'present')


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
87
88
89
90
# File 'manifests/jaas.pp', line 15

define tomcat::jaas (
                            #LDAP zookeeper
                            $app                 = undef,
                            $provider            = undef,
                            $filter              = undef,
                            $username            = 'tomcat',
                            $password            = 'tomcat',
                            #KRB5
                            $realm               = undef,
                            $spn                 = undef,
                            $debug               = false,
                            #altres
                            $servicename         = $name,
                            $catalina_base       = "/opt/${name}",
                            $ensure              = 'present',
                          ) {

  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
  }

  case $ensure
  {
    'present':
    {
      if($debug)
      {
        #TODO: identificar LDAP vs kerberos
        #-Dsun.security.krb5.debug=true
        tomcat::jvmproperty { "${catalina_base} sun.security.krb5.debug":
          property      => 'sun.security.krb5.debug',
          value         => $debug,
          servicename   => $servicename,
          catalina_base => $catalina_base,
        }
      }

      #java.security.auth.login.config
      tomcat::jvmproperty { "${catalina_base} java.security.auth.login.config":
        property      => 'java.security.auth.login.config',
        value         => "${catalina_base}/conf/jaas.conf",
        servicename   => $servicename,
        catalina_base => $catalina_base,
        require       => File["${catalina_base}/conf/jaas.conf"],
      }

    }
    'absent':
    {
    }
    default:
    {
      fail('unsupported ensure for tomcat::jaas')
    }
  }

  file { "${catalina_base}/conf/jaas.conf":
    ensure  => $ensure,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    require => File["${catalina_base}/conf"],
    notify  => $serviceinstance,
    content => template("${module_name}/conf/jaas.erb"),
  }
}