Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Commit

Permalink
custom_fragment becomes custom_variables (hash)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoineco committed Jan 23, 2015
1 parent 7086979 commit a435754
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
###0.9.0

**Warning:** this release is a big step forward, please read the documentation carefully

* New `listeners` parameters: create custom Listener components within the server configuration
* New Server parameters. Warning: `control_port` renamed to `server_control_port`
- `server_control_port`
Expand All @@ -22,6 +24,7 @@
- `host_unpackwars`
- `host_params`
* Fix instance startup on Fedora 20+, drop support for Fedora 15 and 16
* `custom_fragment` renamed to `custom_variables` (hash)
* Refactoring

###0.8.2
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ The tomcat module installs and configures Apache Tomcat instances from either th
##Module description

This module will install the desired version of the Apache Tomcat Web Application Container from almost any possible source, including the repositories available on the target system (distribution repositories or third-party sources like [JPackage](http://www.jpackage.org) and [EPEL](https://fedoraproject.org/wiki/EPEL))
A long list of parameters permit a fine-tuning of the server and the JVM. Tomcat's most common elements are provided, and virtually any missing parameters can be included using the provided hash parameters in each block.
It also possible to configure, besides the server itself, admin applications, extra libraries, the log4j logger, etc.
The creation of individual instances following [Apache's guidelines](http://tomcat.apache.org/tomcat-8.0-doc/RUNNING.txt) is also supported via a custom type.
A long list of parameters permit a fine-tuning of the server and the JVM. Tomcat's most common elements are provided, and virtually any missing parameters can be included using the hash parameters present in each block.
It is also possible to configure, besides the server itself, admin applications, extra libraries, the log4j logger, etc.
The creation of individual instances following [Apache's guidelines](http://tomcat.apache.org/tomcat-8.0-doc/RUNNING.txt) is supported via a custom type.

##Setup

Expand Down Expand Up @@ -54,7 +54,7 @@ class { '::tomcat':
}
```

Disable default instance and setup 2 individual instances
Disable main instance and setup 2 individual instances

```puppet
class { '::tomcat':
Expand Down Expand Up @@ -164,6 +164,7 @@ class { '::tomcat':
{ port => 9081,
allowTrace => true
}
]
}
```

Expand Down Expand Up @@ -482,8 +483,8 @@ How long to wait for a graceful shutdown before killing the process. Value in se
#####`shutdown_verbose`
Whether to display start/shutdown messages. Boolean value. Only available on RedHat 6 systems if installed from package. Defaults to `false`.

#####`custom_fragment`
Custom environment variables, one per line.
#####`custom_variables`
Hash of custom environment variables.

**Logging**

Expand Down
4 changes: 2 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
$jpda_address = $::tomcat::jpda_address
$jpda_suspend = $::tomcat::jpda_suspend
$jpda_opts_real = $::tomcat::jpda_opts_real
$custom_fragment = $::tomcat::custom_fragment
$custom_variables = $::tomcat::custom_variables

# generate and manage server configuration
concat { 'tomcat server configuration':
Expand Down Expand Up @@ -272,7 +272,7 @@
# - $jpda_address
# - $jpda_suspend
# - $jpda_opts_real
# - $custom_fragment
# - $custom_variables
file { 'tomcat environment variables':
path => $::tomcat::config_path_real,
content => template("${module_name}/common/setenv.erb"),
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
$lang = undef,
$shutdown_wait = 30,
$shutdown_verbose = false,
$custom_fragment = undef) inherits tomcat::params {
$custom_variables = {}) inherits tomcat::params {
# get major version
$array_version = split($version, '[.]')
$maj_version = $array_version[0]
Expand Down
4 changes: 2 additions & 2 deletions manifests/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
$lang = undef,
$shutdown_wait = 30,
$shutdown_verbose = false,
$custom_fragment = undef) {
$custom_variables = {}) {
# The base class must be included first
if !defined(Class['tomcat']) {
fail('You must include the tomcat base class before using any tomcat defined resources')
Expand Down Expand Up @@ -776,7 +776,7 @@
# - $jpda_address
# - $jpda_suspend
# - $jpda_opts_real
# - $custom_fragment
# - $custom_variables
file { "instance ${name} environment variables":
path => $config_path_real,
content => template("${module_name}/common/setenv.erb"),
Expand Down
6 changes: 5 additions & 1 deletion templates/common/setenv.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ SHUTDOWN_VERBOSE="<%= @shutdown_verbose %>"
<% end -%>

# Custom variables
<% if @custom_fragment and @custom_fragment != '' -%><%= @custom_fragment %><% end -%>
<%- if @custom_variables and ! @custom_variables.empty? -%>
<%- @custom_variables.each_pair do |attrib, value| -%>
<%= attrib %>="<%= value %>"
<%- end -%>
<%- end -%>

0 comments on commit a435754

Please sign in to comment.