puppetlabs / puppetlabs-tomcat Goto Github PK
View Code? Open in Web Editor NEWPuppetLabs Tomcat module
Home Page: https://forge.puppetlabs.com/puppetlabs/tomcat
License: Apache License 2.0
PuppetLabs Tomcat module
Home Page: https://forge.puppetlabs.com/puppetlabs/tomcat
License: Apache License 2.0
Maybe I missed it, but I can't figure out how to use this module to configure a tomcat 10 with TLS support. Since Version 8.5 an SSLHostConfig within the connector in the server.xml is possible and how it seems to me since version 10 it is mandatory.
https://tomcat.apache.org/tomcat-10.1-doc/ssl-howto.html#Edit_the_Tomcat_Configuration_File
Please add support for an SSLHostConfig to tomcat::config::server::connector
Best regards and many thanks in advance,
Dirk
When upgrading this module from 6.3.0 to 6.4.0 using Stdlib::Port data type as argument to tomcat::config::server::port fails with
Tomcat::Config::Server[am-server]: parameter 'port' expects a value of type Undef or String, got Integer
Minor version upgrades should never break like this.
Stdlib data types should always be allowed in puppetlabs modules.
metadata.json
on current master
has changes which are need to allow puppet/archive
6.x to be used within a puppet environment. This issue is requesting that a new forge release be made from the current master
.
Since upgrade to Apache 8.5.84 nightly and PR tests are failing with:
Error: Working directory /opt/apache-tomcat/bin/commons-daemon-1.3.1-native-src/unix does not exist!
e.g: https://github.com/puppetlabs/puppetlabs-tomcat/actions/runs/3869636565/jobs/6595886291#step:13:354
Looks like commons-daemon was updated from 1.3.1 to 1.3.2 with Tomcat 8.5.84 so needs a bump of the daemon_version in spec/acceptance/acceptance_1b_spec.rb
Previously i opened an issue with a type being wrong but i'm facing an other issue which can be resolved on my side but i think an overal review of the different new var types should be considered.
I'll try to describe some "wrong" types.
To match var types better with their purpose
I'll add examples from where i would change types i will not include all params or go through all classes but just pasting some most used probably.
define tomcat::config::server (
Optional[String[1]] $address = undef, => since this has to be TCP/IP address check better instead of string
Optional[String[1]] $port = undef, => Change to integer or variant [string, integer]
Optional[String[1]] $server_config = undef, => Change to absolutepath since docs says "valid option string containing absolutepath"
) {
define tomcat::install (
String[1] $catalina_home = $name, => Change to absolutepath since docs says "valid option string containing absolutepath"
Optional[String[1]] $source_url = undef, => Change to enum or update docs this is not check but docs says "Valid options: a string containing a puppet://
, http(s)://
, or ftp://
"
Optional[String[1]] $proxy_server = undef, => Could be checked better to since you have an enum on proxy_type
) {
This is ofc just a suggestion but stricter checking or using the correct types will help everyone in my opinion :)
In previous version 6.3.0 no type was given to for paramter $package_ensure in define tomcat::install
But with 6.4.0 a type is given but the type is boolean which i think is wrong because you pass it through to an other class and there the type is Optional[String[1]] which in my opinion is the correct one.
That i can use a string for package_ensure.
Steps to reproduce the behavior:
Trying to run this code
tomcat::install { $catalina_home:
install_from_source => false,
package_name => 'tomcat',
package_ensure => '10.1.5',
}
I am attempting to add the attribute crossContext="true" to the Context element in $CATALINA_BASE/conf/context.xml
On reading the documentation tomcat::config::context suggests it might be something it can do:
Configure attributes for the Context element in $CATALINA_BASE/conf/context.xml
However it appears that this define type is hard coded to just set Context/WatchedResource/#text "WEB-INF/web.xml"
The ability to set attributes of the Context element. Potentially through adding $additional_attributes and $attributes_to_remove to tomcat::config::context define type
I've not found another way of achieving this result using this module.
Property "name" don't exist in tomcat documentation and generate a warning
define tomcat::config::context::resources
add a unexisting property "name"
tomcat::config::context::resources { 'resources':
ensure => 'present',
catalina_base => '/opt/tomcat',
additional_attributes => { 'cachingAllowed' => 'false' },
notify => Service['tomcat'],
}
context.xml
<Context>
….
<Resources name="resources" cachingAllowed="false"></Resources>
</Context>
catalina.out
WARNING property name (value resources) can't fixed
AVERTISSEMENT [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin La correspondance [Context/Resources] n'a pu fixer la propriété [name] à [resources]
The way archive is used with the installation from source does not work in my setup. It seems curl doesn't download the archive.
curl should download the archive which in turn should be extracted in place.
I provided PR #559 as a workaround
It appears that the following classes act on the server.xml
file before that file is actually copied to the instance's config directory from the home config directory. The result is a mis-formatted server.xml
file that includes the connector, host and valve sections only, preventing tomcat from starting.
The only way to successfully deploy is using
require => File["${catalina_base}/conf/server.xml"], # Added to solve a dependency problem in tomcat module
This file resource comes from tomcat::instance::copy_from_home
, which suggests that the dependency is missing in this module.
Manipulation of server.xml
(as well as other config files) should occur only after the tomcat::instance
class has completed copying these files from the home config directory.
server.xml
using tomcat::config::server::connector
server.xml
file that only contains this stanza, instead of editing a previously-existing server.xml
fileThis excerpt from my tomcat server configuration demonstrates the workaround.
...
### MINGLE INSTANCE
tomcat::instance { 'mingle':
catalina_home => $catalina_home,
catalina_base => $catalina_base,
require => File['Mingle Unit File'],
service_name => 'mingle',
use_init => true,
manage_service => true,
manage_copy_from_home => true, # Copy initial config files from tomcat to this instance
user => $t['user'],
group => $t['user'],
}
...
# Listen Socket
# - removes 'redirectPort' because this instance only listens on http
# - adds 'relaxed' attributes to allow mingle to use '[]' in urls, which is now bad practice
tomcat::config::server::connector { "mingle-http-${port['http']}":
catalina_base => $catalina_base,
port => $port['http'], # Server socket port
protocol => 'HTTP/1.1',
purge_connectors => true,
attributes_to_remove => ['redirectPort'], # This instance is behind a reverse proxy and only listens on http
additional_attributes => {
'relaxedPathChars' => '[ ]', # Mingle requires "relaxed path" characters
'relaxedQueryChars' => '[ ]',
},
require => File["${catalina_base}/conf/server.xml"], # Added to solve a dependency problem in tomcat module
}
...
The puppetlabs-tomcat module states it has Puppet 8 compatibility, however it has a dependency upon a version of the puppet-archive module which doesn't support Puppet 8. Currently puppetlabs-tomcat 7.1.0 requires a version of puppet-archive >= 1.0.0 < 7.0.0. However puppet-archive is not Puppet 8 compatible until version 7.1.0, which is outside of the puppet-tomcat dependency range.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.