puppet master not updating tomcat connector port, instead it is defining another connector port in the server.xml file

asked 2017-05-29 19:32:58 -0500

updated 2017-05-30 10:41:43 -0500

smarlow gravatar image

Hi I am trying run multiple tomcat instances on same node/host with different ports. For second tomcat instance I am explicitly defining connector port with 8081 using tomcat::config::server::connector, but puppet master instead of updating exiting Connector port in the second tomcat instance, it is defining new tag at the end of server.xml file and due to this I am end up with having two connector port (one is 8080 and 8081). Also, the default connector port 8080 taking precedence over 8081 (or server not recognizing 8081 port)

Is there any solution to update exiting connector port instead of creating new connector tag in the server.xml using puppet master.

Here is the puppet master site.pp file snippet

class { 'java':
package => 'java-1.8.0-openjdk-devel',
}
tomcat::install { '/opt/tomcat9':
  source_url => 'https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.0.M1/bin/apache-tomca
t-9.0.0.M1.tar.gz'
}
tomcat::instance { 'tomcat-first':
  catalina_home => '/opt/tomcat9',
  catalina_base => '/opt/tomcat9/first',
}
tomcat::instance { 'tomcat-second':
  catalina_home => '/opt/tomcat9',
  catalina_base => '/opt/tomcat9/second',
}
tomcat::config::server { 'tomcat-second':
  catalina_base => '/opt/tomcat9/second',
  port          => '8006',
}
tomcat::config::server::connector { 'tomcat-second-http':
  catalina_base         => '/opt/tomcat9/second',
  port                  => '8081',
  protocol              => 'HTTP/1.1',
  additional_attributes => {
    'redirectPort' => '8443'
  },
}
edit retag flag offensive close merge delete

Comments

which tomcat module are you using from the puppetforge?

DarylW gravatar imageDarylW ( 2017-05-30 10:59:44 -0500 )edit

Hi Daryl, Thanks for the reply and here is the details. puppetlabs-tomcat (v1.7.0) puppet-staging (v2.2.0) puppetlabs-concat (v2.2.1) puppetlabs-stdlib (v4.17.0)

Ashokms gravatar imageAshokms ( 2017-05-30 23:11:03 -0500 )edit