I've the following manifest to configure Tomcat to use 8983 port instead:
include java
class { 'tomcat': install_from_source => false }
tomcat::instance {'default': package_name => 'tomcat7'} ->
tomcat::service {'default':
use_jsvc => false, use_init => true, service_name => 'tomcat7'
}->
tomcat::config::server { 'tomcat7':
catalina_base => '/usr/share/tomcat7',
port => 8983,
}
However when run, I've got the following errors:
$ sudo puppet apply -vd tomcat-test.pp
debug: Augeas[server-/usr/share/tomcat7](provider=augeas): Augeas version 1.3.0 is installed
debug: Augeas[server-/usr/share/tomcat7](provider=augeas): sending command 'set' with params ["/files/usr/share/tomcat7/conf/server.xml/Server/#attribute/port", "8983"]
debug: Augeas[server-/usr/share/tomcat7](provider=augeas): Closed the augeas connection
err: /Stage[main]//Tomcat::Config::Server[tomcat7]/Augeas[server-/usr/share/tomcat7]: Could not evaluate: Save failed with return code false
Which indicates that Augeas is trying to modify the wrong file (/usr/share/tomcat7/conf/server.xml
) which is in /etc/tomcat7
.
At puppetlabs-tomcat GitHub we can read:
tomcat::config::server: Configures attributes for the Server element in
$CATALINA_BASE/conf/server.xml
.
$catalina_base
Specifies the base directory for the Tomcat installation.
which suggest I should have conf
dir in Tomcat base folder (CATALINA_BASE
), but it isn't there, as all the configuration is in stored separately in /etc/tomcat7
.
See: Tomcat documentation.
Is there any way that puppetlabs-tomcat
module can somehow handle properly the default installed instance of Tomcat? Or I should create a symbolic link?
It seems that the
catalina_base
attribute it incorrect, i.e., theCATALINA_HOME
has been defined instead ofCATALINA_BASE
. Change it to/var/lib/tomcat7
and run puppet again.