Defined Type: tomcat::resource

Defined in:
manifests/resource.pp

Overview

ORACLE JDBC ==

The relevant documentation for this is quite heavy going, but these are key documents

http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
http://docs.oracle.com/cd/B28359_01/java.111/b31224/concache.htm
https://forums.oracle.com/forums/thread.jspa?threadID=967849

To set debug logging see following URL and edit logging.properties

http://dev-answers.blogspot.com/2010/03/enable-debugtrace-level-logging-for.html

To reference include files from server.xml see

http://blogs.mulesoft.org/including-files-into-tomcats-server-xml-using-xml-entity-includes/

Note this subtle but crucial difference for SID vs SERVICE_NAME based connections.

Old form: jdbc:oracle:thin:<host>:<port>:<SID>
New form: jdbc:oracle:thin:@<host>:<port>/<SERVICE_NAME>

puppet2sitepp @tomcatresources

Parameters:

  • resource_type (Any)
  • resource_name (Any)
  • servicename (Any) (defaults to: $name)
  • catalina_base (Any) (defaults to: "/opt/${name}")
  • factory (Any) (defaults to: undef)
  • driver_class_name (Any) (defaults to: undef)
  • resource_url (Any) (defaults to: undef)
  • username (Any) (defaults to: undef)
  • user (Any) (defaults to: undef)
  • password (Any) (defaults to: undef)
  • initial_size (Any) (defaults to: undef)
  • max_active (Any) (defaults to: undef)
  • max_idle (Any) (defaults to: undef)
  • min_idle (Any) (defaults to: undef)
  • max_wait (Any) (defaults to: undef)
  • validation_query (Any) (defaults to: undef)
  • min_evictable_idletimemillis (Any) (defaults to: undef)
  • time_between_evictionrunsmillis (Any) (defaults to: undef)
  • numtests_per_evictionrun (Any) (defaults to: undef)
  • init_sql (Any) (defaults to: undef)
  • auth (Any) (defaults to: undef)
  • location (Any) (defaults to: undef)


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

define tomcat::resource (
                          $resource_type,
                          $resource_name,
                          $servicename                     = $name,
                          $catalina_base                   = "/opt/${name}",
                          $factory                         = undef,
                          $driver_class_name               = undef,
                          $resource_url                    = undef,
                          $username                        = undef,
                          $user                            = undef,
                          $password                        = undef,
                          $initial_size                    = undef,
                          $max_active                      = undef,
                          $max_idle                        = undef,
                          $min_idle                        = undef,
                          $max_wait                        = undef,
                          $validation_query                = undef,
                          $min_evictable_idletimemillis    = undef,
                          $time_between_evictionrunsmillis = undef,
                          $numtests_per_evictionrun        = undef,
                          $init_sql                        = undef,
                          $auth                            = undef,
                          $location                        = undef,
                        ) {
  #
  if ! defined(Class['tomcat'])
  {
    fail('You must include the tomcat base class before using any tomcat defined resources')
  }

  if(!defined(Concat::Fragment["${catalina_base}/conf/server.xml globalnamingresources ini"]))
  {
    concat::fragment{ "${catalina_base}/conf/server.xml globalnamingresources ini":
      target  => "${catalina_base}/conf/server.xml",
      order   => '10',
      content => template("${module_name}/serverxml/10_global_naming_resources_init.erb"),
    }
  }

  concat::fragment{ "${catalina_base}/conf/server.xml resource ${resource_type} ${resource_name}":
    target  => "${catalina_base}/conf/server.xml",
    order   => '11',
    content => template("${module_name}/serverxml/11_resource.erb"),
  }

  if(!defined(Concat::Fragment["${catalina_base}/conf/server.xml globalnamingresources end"]))
  {
    concat::fragment{ "${catalina_base}/conf/server.xml globalnamingresources end":
      target  => "${catalina_base}/conf/server.xml",
      order   => '12',
      content => template("${module_name}/serverxml/12_global_naming_resources_fi.erb"),
    }
  }

}