2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#This file is generated by ModuleSync, do not edit.
*.rb eol=lf
*.erb eol=lf
*.pp eol=lf
*.sh eol=lf
*.epp eol=lf
13 changes: 13 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@
/convert_report.txt
/update_report.txt
.DS_Store
/appveyor.yml
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/Rakefile
/.rspec
/.rubocop.yml
/.travis.yml
/.yardopts
/spec/
Empty file added .puppet-lint.rc
Empty file.
12 changes: 4 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
---
sudo: false
dist: trusty
language: ruby
cache: bundler
before_install:
- bundle -v
- rm -f Gemfile.lock
- gem update --system
- gem update --system $RUBYGEMS_VERSION
- gem --version
- bundle -v
script:
- 'bundle exec rake $CHECK'
bundler_args: --without system_tests
rvm:
- 2.5.0
- 2.5.1
env:
global:
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0"
Expand All @@ -24,15 +23,15 @@ matrix:
bundler_args:
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/centos-7 BEAKER_TESTMODE=apply
rvm: 2.5.0
rvm: 2.5.1
script: bundle exec rake beaker
services: docker
sudo: required
-
bundler_args:
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/ubuntu-14.04 BEAKER_TESTMODE=apply
rvm: 2.5.0
rvm: 2.5.1
script: bundle exec rake beaker
services: docker
sudo: required
Expand All @@ -43,9 +42,6 @@ matrix:
-
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
rvm: 2.4.4
-
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
rvm: 2.1.9
branches:
only:
- master
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [2.5.0](https://github.com/puppetlabs/puppetlabs-tomcat/tree/2.5.0) (2019-01-29)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-tomcat/compare/2.4.0...2.5.0)

### Added

- \(MODULES-8147\) - Add SLES 15 support [\#328](https://github.com/puppetlabs/puppetlabs-tomcat/pull/328) ([eimlav](https://github.com/eimlav))
- Add context parameter type \(re-submit \#205\) [\#317](https://github.com/puppetlabs/puppetlabs-tomcat/pull/317) ([joshbeard](https://github.com/joshbeard))

### Fixed

- \(maint\) - Ubuntu 18.04 issues fix [\#333](https://github.com/puppetlabs/puppetlabs-tomcat/pull/333) ([david22swan](https://github.com/david22swan))
- pdksync - \(FM-7655\) Fix rubygems-update for ruby \< 2.3 [\#330](https://github.com/puppetlabs/puppetlabs-tomcat/pull/330) ([tphoney](https://github.com/tphoney))
- \[MODULES-7547\] Update globalnamingresource class, and add tests [\#305](https://github.com/puppetlabs/puppetlabs-tomcat/pull/305) ([jplindquist](https://github.com/jplindquist))

## [2.4.0](https://github.com/puppetlabs/puppetlabs-tomcat/tree/2.4.0) (2018-10-03)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-tomcat/compare/2.3.0...2.4.0)
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ group :development do
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '<= 2.0.4', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Puppet removes any existing Connectors or Realms and leaves only the ones you've

## Reference

See [REFERENCE.md] for all Reference information.
See [REFERENCE.md](https://github.com/puppetlabs/puppetlabs-tomcat/blob/master/REFERENCE.md)

## Limitations

Expand Down
58 changes: 58 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ _Public Defined types_
* [`tomcat::config::context`](#tomcatconfigcontext): Configure attributes for the Context element in $CATALINA_BASE/conf/context.xml
* [`tomcat::config::context::environment`](#tomcatconfigcontextenvironment): Configure Environment elements in $CATALINA_BASE/conf/context.xml
* [`tomcat::config::context::manager`](#tomcatconfigcontextmanager): Configure Manager elements in $CATALINA_BASE/conf/context.xml
* [`tomcat::config::context::parameter`](#tomcatconfigcontextparameter): Configure Parameter elements in $CATALINA_BASE/conf/context.xml.
* [`tomcat::config::context::resource`](#tomcatconfigcontextresource): Configure Resource elements in $CATALINA_BASE/conf/context.xml
* [`tomcat::config::context::resourcelink`](#tomcatconfigcontextresourcelink): Configure a ResourceLink element in the designated xml config.
* [`tomcat::config::context::valve`](#tomcatconfigcontextvalve): Specifies Valve elements in `${catalina_base}/conf/context.xml`
Expand Down Expand Up @@ -295,6 +296,63 @@ Specifies an array of attributes to remove from the element. Valid options: an a

Default value: []

### tomcat::config::context::parameter

Configure Parameter elements in $CATALINA_BASE/conf/context.xml.

#### Parameters

The following parameters are available in the `tomcat::config::context::parameter` defined type.

##### `ensure`

Data type: `Variant[Enum['present', 'absent'], Boolean]`

Specifies whether you are trying to add or remove the Parameter element Valid options: 'present', 'absent'.

Default value: 'present'

##### `catalina_base`

Data type: `Pattern[/^(\/[^\/ ]*)+\/?$/]`

Specifies the root of the Tomcat installation.

Default value: $::tomcat::catalina_home

##### `parameter_name`

Data type: `String`

The name of the Parameter entry to be created, relative to the `java:comp/env` context. `$name`.

Default value: $name

##### `value`

Data type: `Optional[String]`

The value that will be presented to the application when requested from the JNDI context.

Default value: `undef`

##### `description`

Data type: `Optional[String]`

The description is an an optional string for a human-readable description of this Parameter entry.

Default value: `undef`

##### `override`

Data type: `Optional[Boolean]`

An optional string or Boolean to specify whether you want an `<env-entry>` for the same Parameter entry name to override the value
specified here (set it to `false`). By default, overrides are allowed.

Default value: `undef`

### tomcat::config::context::resource

Configure Resource elements in $CATALINA_BASE/conf/context.xml
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any?

def changelog_user
return unless Rake.application.top_level_tasks.include? "changelog"
Expand Down
69 changes: 69 additions & 0 deletions manifests/config/context/parameter.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# @summary Configure Parameter elements in $CATALINA_BASE/conf/context.xml.
#
# @param ensure
# Specifies whether you are trying to add or remove the Parameter element Valid options: 'present', 'absent'.
# @param catalina_base
# Specifies the root of the Tomcat installation.
# @param parameter_name
# The name of the Parameter entry to be created, relative to the `java:comp/env` context. `$name`.
# @param value
# The value that will be presented to the application when requested from the JNDI context.
# @param description
# The description is an an optional string for a human-readable description of this Parameter entry.
# @param override
# An optional string or Boolean to specify whether you want an `<env-entry>` for the same Parameter entry name to override the value
# specified here (set it to `false`). By default, overrides are allowed.
#
define tomcat::config::context::parameter (
Optional[String] $value = undef,
Variant[Enum['present', 'absent'], Boolean] $ensure = 'present',
Pattern[/^(\/[^\/ ]*)+\/?$/] $catalina_base = $::tomcat::catalina_home,
String $parameter_name = $name,
Optional[String] $description = undef,
Optional[Boolean] $override = undef,
) {
if versioncmp($::augeasversion, '1.0.0') < 0 {
fail('Server configurations require Augeas >= 1.0.0')
}

$base_path = "Context/Parameter[#attribute/name='${parameter_name}']"

if $ensure =~ /^(absent|false)$/ {
$changes = "rm ${base_path}"
}
else {

if empty($value) {
fail('$value must be specified')
}

$set_name = "set ${base_path}/#attribute/name ${parameter_name}"
$set_value = "set ${base_path}/#attribute/value ${value}"

if $override != undef {
$_override = bool2str($override)
$set_override = "set ${base_path}/#attribute/override ${_override}"
} else {
$set_override = "rm ${base_path}/#attribute/override"
}

if ! empty($description) {
$set_description = "set ${base_path}/#attribute/description \'${description}\'"
} else {
$set_description = "rm ${base_path}/#attribute/description"
}

$changes = delete_undef_values(flatten([
$set_name,
$set_value,
$set_override,
$set_description,
]))
}

augeas { "context-${catalina_base}-parameter-${name}":
lens => 'Xml.lns',
incl => "${catalina_base}/conf/context.xml",
changes => $changes,
}
}
18 changes: 9 additions & 9 deletions manifests/config/server/globalnamingresource.pp
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@
$set_additional_attributes,
$rm_attributes_to_remove,
]))
}

# (MODULES-3353) This should use $set_name in $changes like
# t:config::context::resource and others instead of an additional augeas
# resource
augeas { "server-${catalina_base}-globalresource-${name}-definition":
lens => 'Xml.lns',
incl => $_server_config,
changes => "set ${base_path}/#attribute/name '${_resource_name}'",
before => Augeas["server-${catalina_base}-globalresource-${name}"],
# (MODULES-3353) This should use $set_name in $changes like
# t:config::context::resource and others instead of an additional augeas
# resource
augeas { "server-${catalina_base}-globalresource-${name}-definition":
lens => 'Xml.lns',
incl => $_server_config,
changes => "set ${base_path}/#attribute/name '${_resource_name}'",
before => Augeas["server-${catalina_base}-globalresource-${name}"],
}
}

augeas { "server-${catalina_base}-globalresource-${name}":
Expand Down
11 changes: 6 additions & 5 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-tomcat",
"version": "2.4.0",
"version": "2.5.0",
"author": "puppetlabs",
"summary": "Installs, deploys, and configures Apache Tomcat web services.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -72,7 +72,8 @@
"operatingsystem": "SLES",
"operatingsystemrelease": [
"11",
"12"
"12",
"15"
]
}
],
Expand All @@ -82,7 +83,7 @@
"version_requirement": ">= 4.7.0 < 7.0.0"
}
],
"template-url": "https://github.com/puppetlabs/pdk-templates",
"template-ref": "heads/master-0-g8fc95db",
"pdk-version": "1.7.0"
"template-url": "https://github.com/puppetlabs/pdk-templates/",
"template-ref": "heads/master-0-g6814a87",
"pdk-version": "1.7.1"
}
Loading