0
votes

I am trying to create the module puppet for install tomcat 8. Tomcat installed successfully, user and role added, but I have following issue whent Tomcat starting... :

/Stage[main]/Main/Node[web_mzol]/Tomcat::Instance[tomcat8]/Tomcat::Config::Properties[/opt/tomcat-8.5 catalina.properties]/Concat[/opt/tomcat-8.5/conf/catalina.properties]/Concat_file[/opt/tomcat-8.5/conf/catalina.properties]: Failed to generate additional resources using 'eval_generate': undefined method `join' for "/opt/apache-tomcat/conf/catalina.properties":String

Error: Could not start Service[tomcat-tomcat8]: Execution of 'su -s /bin/bash -c 'CATALINA_HOME=/opt/apache-tomcat CATALINA_BASE=/opt/apache-tomcat /opt/apache-tomcat/bin/catalina.sh start' tomcat' returned 127: bash: /opt/apache-tomcat/bin/catalina.sh: No such file or directory

As I see, puppet using wrong value variable "/opt/apache-tomcat", but must use "/opt/tomcat-8.5"... or other reason?

main manifest /etc/puppetlabs/code/environments/production/manifests/site.pp :

node 'web_mzol' {
  package { 'nginx' :
  ensure => installed,
} -> 
  service {'nginx': 
   ensure => running, 
   enable => true, 
  }
 class { '::tomcat': }
 class { '::java': }
tomcat::instance { 'tomcat8':
  catalina_base => '/opt/tomcat-8.5',
  source_url => 'https://www-us.apache.org/dist/tomcat/tomcat-8/v8.5.28/src/apache-tomcat-8.5.28-src.tar.gz',
}
-> tomcat::config::server::tomcat_users {
  'tet-role-manager-script':
    ensure        => present,
    catalina_base => '/opt/tomcat-8.5',
    element       => 'role',
    element_name  => 'manager-script';
  'tet-user-mzol':
    ensure        => present,
    catalina_base => '/opt/tomcat-8.5',
    element       => 'user',
    element_name  => 'mzol',
    password      => 'mzol',
    roles         => ['manager-script'];
}
-> tomcat::service { 'tomcat8':
   }
}
node default {}

Thanks

1
as far as i know $catalina_base is an optional variable for multiple tomcats on the single host. But $catalina_home is the default, which in your case might have been overrided by $catalina_base that you tried to set using puppet.hopetds
how to fix it? I try define catalina_home, but it did't help and I have the same issue...mushko12

1 Answers

1
votes

I fixed it.

node 'web_mzol' {
  package { 'nginx' :
   ensure => installed,
  } -> # Order of the execution, service will be started after the installation
  service {'nginx': # Name of the service
   ensure => running, # Start the apache service
   enable => true, # Start on system boot
  }
 class { '::tomcat': }
 class { '::java': }

tomcat::instance { 'tom':
  catalina_home => '/opt/tomcat-8.5',
  source_url => 'https://www-us.apache.org/dist/tomcat/tomcat-8/v8.5.28/bin/apache-tomcat-8.5.28.tar.gz',
  catalina_base => '/opt/tomcat-8.5',
}
-> tomcat::config::server::tomcat_users {
  'tet-role-manager-script':
    ensure        => present,
    catalina_base => '/opt/tomcat-8.5',
    element       => 'role',
    element_name  => 'manager-script';
  'tet-user-mzol':
    ensure        => present,
    catalina_base => '/opt/tomcat-8.5',
    element       => 'user',
    element_name  => 'mzol',
    password      => 'mzol',
    roles         => ['manager-script'];
}