2

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?

kenorb
  • 5,943
  • 1
  • 44
  • 53

1 Answers1

1

It seems that the catalina_base attribute it incorrect, i.e., the CATALINA_HOME has been defined instead of CATALINA_BASE. Change it to /var/lib/tomcat7 and run puppet again.

030
  • 5,731
  • 12
  • 61
  • 107
  • 1
    When upgrading `augeas`, I haven't upgraded `augeas-lense` with it (seems it didn't catch the dependency automatically), now it works:) It probably could work with the older puppet either, however older puppet was printing only limited debug messages about Augeas, the upgraded one showed much more such for example `/augeas/load/Xfm/error = /usr/share/augeas/lenses/dist/xml.aug:114.21-.35:type error: expected lens but found regexp` which suggested problem with augeas. – kenorb Apr 01 '15 at 21:32