27 changes: 0 additions & 27 deletions .github/workflows/labeller.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,3 @@ Gemfile:
- gem: rspec-retry
version: '= 0.4.5'
platforms: ruby
- gem: github_changelog_generator
version: '= 1.15.2'
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ 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).

## [v7.2.0](https://github.com/puppetlabs/puppetlabs-tomcat/tree/v7.2.0) - 2023-12-08
## [v7.3.0](https://github.com/puppetlabs/puppetlabs-tomcat/tree/v7.3.0) - 2024-10-10

[Full Changelog](https://github.com/puppetlabs/puppetlabs-tomcat/compare/v7.2.0...v7.3.0)

### Added

- Adding support for sslhostconfig options [#569](https://github.com/puppetlabs/puppetlabs-tomcat/pull/569) ([malikparvez](https://github.com/malikparvez))

## [v7.2.0](https://github.com/puppetlabs/puppetlabs-tomcat/tree/v7.2.0) - 2024-01-09

[Full Changelog](https://github.com/puppetlabs/puppetlabs-tomcat/compare/v7.1.0...v7.2.0)

Expand Down Expand Up @@ -36,6 +44,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
[Full Changelog](https://github.com/puppetlabs/puppetlabs-tomcat/compare/v6.4.1...v7.0.0)

### Changed

- (CONT-802) - add puppet 8/drop puppet 6 [#523](https://github.com/puppetlabs/puppetlabs-tomcat/pull/523) ([jordanbreen28](https://github.com/jordanbreen28))

## [v6.4.1](https://github.com/puppetlabs/puppetlabs-tomcat/tree/v6.4.1) - 2023-03-23
Expand Down Expand Up @@ -104,6 +113,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
[Full Changelog](https://github.com/puppetlabs/puppetlabs-tomcat/compare/v5.1.0...v6.0.0)

### Changed

- [IAC-1690] - Remove tomcat7 as is EOL [#459](https://github.com/puppetlabs/puppetlabs-tomcat/pull/459) ([daianamezdrea](https://github.com/daianamezdrea))

### Added
Expand Down Expand Up @@ -132,6 +142,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
[Full Changelog](https://github.com/puppetlabs/puppetlabs-tomcat/compare/v4.3.0...v5.0.0)

### Changed

- pdksync - Remove Puppet 5 from testing and bump minimal version to 6.0.0 [#431](https://github.com/puppetlabs/puppetlabs-tomcat/pull/431) ([carabasdaniel](https://github.com/carabasdaniel))

## [v4.3.0](https://github.com/puppetlabs/puppetlabs-tomcat/tree/v4.3.0) - 2020-12-14
Expand Down Expand Up @@ -177,6 +188,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
[Full Changelog](https://github.com/puppetlabs/puppetlabs-tomcat/compare/v3.1.0...v4.0.0)

### Changed

- (MAINT) Make ensurable enums consistent [#367](https://github.com/puppetlabs/puppetlabs-tomcat/pull/367) ([smortex](https://github.com/smortex))

### Added
Expand Down Expand Up @@ -207,6 +219,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
[Full Changelog](https://github.com/puppetlabs/puppetlabs-tomcat/compare/2.5.0...v3.0.0)

### Changed

- pdksync - (MODULES-8444) - Raise lower Puppet bound [#347](https://github.com/puppetlabs/puppetlabs-tomcat/pull/347) ([david22swan](https://github.com/david22swan))

### Fixed
Expand Down Expand Up @@ -293,6 +306,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
[Full Changelog](https://github.com/puppetlabs/puppetlabs-tomcat/compare/1.7.0...2.0.0)

### Changed

- (maint Remove validate calls and update lint/docs [#223](https://github.com/puppetlabs/puppetlabs-tomcat/pull/223) ([hunner](https://github.com/hunner))

### Added
Expand Down Expand Up @@ -418,7 +432,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
### Fixed

- [#puppethack] Validate that catalina_base does not to end with / [#102](https://github.com/puppetlabs/puppetlabs-tomcat/pull/102) ([igalic](https://github.com/igalic))
- Wrap username attribute in quotes. [#100](https://github.com/puppetlabs/puppetlabs-tomcat/pull/100) ([bcornies](https://github.com/bcornies))
- Wrap username attribute in quotes. [#100](https://github.com/puppetlabs/puppetlabs-tomcat/pull/100) ([bryancornies](https://github.com/bryancornies))

## [1.3.1](https://github.com/puppetlabs/puppetlabs-tomcat/tree/1.3.1) - 2015-07-21

Expand Down
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ group :development do
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
gem "facterdb", '~> 1.18', require: false
gem "metadata-json-lint", '~> 3.0', require: false
gem "puppetlabs_spec_helper", '~> 6.0', require: false
gem "rspec-puppet-facts", '~> 2.0', require: false
gem "codecov", '~> 0.2', require: false
gem "dependency_checker", '~> 1.0.0', require: false
Expand All @@ -33,17 +34,17 @@ group :development do
gem "rubocop", '= 1.48.1', require: false
gem "rubocop-performance", '= 1.16.0', require: false
gem "rubocop-rspec", '= 2.19.0', require: false
gem "puppet-strings", '~> 4.0', require: false
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "rspec-retry", '= 0.4.5', require: false, platforms: [:ruby]
gem "github_changelog_generator", '= 1.15.2', require: false
end
group :system_tests do
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
gem "serverspec", '~> 2.41', require: false
end
group :release_prep do
gem "puppet-strings", '~> 4.0', require: false
gem "puppetlabs_spec_helper", '~> 7.0', require: false
gem "puppetlabs_spec_helper", '~> 6.0', require: false
end

puppet_version = ENV['PUPPET_GEM_VERSION']
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ tomcat::instance { 'my_tomcat_app':
port => $https_port,
protocol => $http_version,
purge_connectors => true,
cert_key_file => '/path/to/key.pem',
cert_file => '/path/to/cert.pem',
cert_chain_file => '/path/to/chain.pem',
cert_type => 'RSA',
additional_attributes => {
'SSLEnabled' => bool2str($https_enabled),
'maxThreads' => $https_connector_max_threads,
Expand Down
36 changes: 36 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,10 @@ The following parameters are available in the `tomcat::config::server::connector
* [`purge_connectors`](#-tomcat--config--server--connector--purge_connectors)
* [`server_config`](#-tomcat--config--server--connector--server_config)
* [`show_diff`](#-tomcat--config--server--connector--show_diff)
* [`cert_key_file`](#-tomcat--config--server--connector--cert_key_file)
* [`cert_file`](#-tomcat--config--server--connector--cert_file)
* [`cert_chain_file`](#-tomcat--config--server--connector--cert_chain_file)
* [`cert_type`](#-tomcat--config--server--connector--cert_type)

##### <a name="-tomcat--config--server--connector--catalina_base"></a>`catalina_base`

Expand Down Expand Up @@ -965,6 +969,38 @@ Specifies display differences when augeas changes files, defaulting to true. Val

Default value: `true`

##### <a name="-tomcat--config--server--connector--cert_key_file"></a>`cert_key_file`

Data type: `Optional[Stdlib::Absolutepath]`

Specifies the path to the private key file. Valid options: a string containing an absolute path.

Default value: `undef`

##### <a name="-tomcat--config--server--connector--cert_file"></a>`cert_file`

Data type: `Optional[Stdlib::Absolutepath]`

Specifies the path to the certificate file. Valid options: a string containing an absolute path.

Default value: `undef`

##### <a name="-tomcat--config--server--connector--cert_chain_file"></a>`cert_chain_file`

Data type: `Optional[Stdlib::Absolutepath]`

Specifies the path to the certificate chain file. Valid options: a string containing an absolute path.

Default value: `undef`

##### <a name="-tomcat--config--server--connector--cert_type"></a>`cert_type`

Data type: `String[1]`

Specifies the type of certificate. Valid options: a string. 'RSA'.

Default value: `'RSA'`

### <a name="tomcat--config--server--context"></a>`tomcat::config::server::context`

Configure a Context element in $CATALINA_BASE/conf/server.xml
Expand Down
80 changes: 0 additions & 80 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,87 +4,7 @@ require 'bundler'
require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator'
require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'

def changelog_user
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = nil || JSON.load(File.read('metadata.json'))['author']
raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator user:#{returnVal}"
returnVal
end

def changelog_project
return unless Rake.application.top_level_tasks.include? "changelog"

returnVal = nil
returnVal ||= begin
metadata_source = JSON.load(File.read('metadata.json'))['source']
metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})

metadata_source_match && metadata_source_match[1]
end

raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?

puts "GitHubChangelogGenerator project:#{returnVal}"
returnVal
end

def changelog_future_release
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version']
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator future_release:#{returnVal}"
returnVal
end

PuppetLint.configuration.send('disable_relative')
PuppetLint.configuration.ignore_paths = ["examples/*.pp", "vendor/**/*.pp", "bundle/**/*.pp", "pkg/**/*.pp", "spec/**/*.pp"]


if Gem.loaded_specs.key? 'github_changelog_generator'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil?
config.user = "#{changelog_user}"
config.project = "#{changelog_project}"
config.since_tag = "v5.0.0"
config.future_release = "#{changelog_future_release}"
config.exclude_labels = ['maintenance']
config.header = "# Change log\n\nAll 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)."
config.add_pr_wo_labels = true
config.issues = false
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
config.configure_sections = {
"Changed" => {
"prefix" => "### Changed",
"labels" => ["backwards-incompatible"],
},
"Added" => {
"prefix" => "### Added",
"labels" => ["enhancement", "feature"],
},
"Fixed" => {
"prefix" => "### Fixed",
"labels" => ["bug", "documentation", "bugfix"],
},
}
end
else
desc 'Generate a Changelog from GitHub'
task :changelog do
raise <<EOM
The changelog tasks depends on recent features of the github_changelog_generator gem.
Please manually add it to your .sync.yml for now, and run `pdk update`:
---
Gemfile:
optional:
':development':
- gem: 'github_changelog_generator'
version: '~> 1.15'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
EOM
end
end

28 changes: 28 additions & 0 deletions manifests/config/server/connector.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
# Specifies a server.xml file to manage. Valid options: a string containing an absolute path.
# @param show_diff
# Specifies display differences when augeas changes files, defaulting to true. Valid options: true or false.
# @param cert_key_file
# Specifies the path to the private key file. Valid options: a string containing an absolute path.
# @param cert_file
# Specifies the path to the certificate file. Valid options: a string containing an absolute path.
# @param cert_chain_file
# Specifies the path to the certificate chain file. Valid options: a string containing an absolute path.
# @param cert_type
# Specifies the type of certificate. Valid options: a string. 'RSA'.
#
define tomcat::config::server::connector (
Optional[Stdlib::Absolutepath] $catalina_base = undef,
Expand All @@ -34,6 +42,10 @@
Optional[Boolean] $purge_connectors = undef,
Optional[Stdlib::Absolutepath] $server_config = undef,
Boolean $show_diff = true,
Optional[Stdlib::Absolutepath] $cert_key_file = undef,
Optional[Stdlib::Absolutepath] $cert_file = undef,
Optional[Stdlib::Absolutepath] $cert_chain_file = undef,
String[1] $cert_type = 'RSA',
) {
include tomcat
$_catalina_base = pick($catalina_base, $tomcat::catalina_home)
Expand Down Expand Up @@ -85,6 +97,21 @@
} else {
$_additional_attributes = undef
}

# Add SSLHostConfig if certificate parameters are provided
if $cert_key_file and $cert_file and $cert_chain_file {
$sslhostconfig_path = "Server/Service/Connector[#attribute/port='${port}']"

$_sslhostconfig_changes = [
"set ${sslhostconfig_path}/SSLHostConfig/Certificate/#attribute/certificateKeyFile ${cert_key_file}",
"set ${sslhostconfig_path}/SSLHostConfig/Certificate/#attribute/certificateFile ${cert_file}",
"set ${sslhostconfig_path}/SSLHostConfig/Certificate/#attribute/certificateChainFile ${cert_chain_file}",
"set ${sslhostconfig_path}/SSLHostConfig/Certificate/#attribute/type ${cert_type}",
]
} else {
$_sslhostconfig_changes = undef
}

if ! empty(any2array($attributes_to_remove)) {
$_attributes_to_remove = prefix(any2array($attributes_to_remove), "rm ${base_path}/#attribute/")
} else {
Expand All @@ -97,6 +124,7 @@
$_protocol_change,
$_additional_attributes,
$_attributes_to_remove,
$_sslhostconfig_changes,
]))
}

Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-tomcat",
"version": "7.2.0",
"version": "7.3.0",
"author": "puppetlabs",
"summary": "Installs, deploys, and configures Apache Tomcat web services.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -92,5 +92,5 @@
],
"template-url": "https://github.com/puppetlabs/pdk-templates#main",
"pdk-version": "3.0.0",
"template-ref": "heads/main-0-g01c6a19"
"template-ref": "heads/main-0-g79a2f93"
}
4 changes: 2 additions & 2 deletions spec/acceptance/acceptance_1_readme_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
pp = <<-MANIFEST
class{'java':}
tomcat::install { '/opt/tomcat':
source_url => '#{TOMCAT8_RECENT_SOURCE}',
source_url => '#{TOMCAT9_RECENT_SOURCE}',
}
tomcat::instance { 'default':
catalina_home => '/opt/tomcat',
Expand Down Expand Up @@ -85,7 +85,7 @@ class { 'java': }
run_shell('rm -rf /opt/apache-tomcat*', expect_failures: true)
end

{ '8' => TOMCAT8_RECENT_SOURCE, '9' => TOMCAT9_RECENT_SOURCE }.each do |key, value|
{ '9' => TOMCAT9_RECENT_SOURCE, '10' => TOMCAT10_RECENT_SOURCE }.each do |key, value|
context "when tomcat #{key} is installed remove_default_webapps => ['docs', 'examples']" do
install_tomcat = <<-MANIFEST
tomcat::install { '/opt/tomcat#{key}':
Expand Down
Loading