Unable to apply Puppetlabs tomcat 2.0.0

asked 2017-10-30 07:35:13 -0600

ewan59 gravatar image

updated 2017-11-03 06:01:28 -0600

llowder gravatar image

I am unable to successfully apply Puppetlabs/tomcat 2.0.0 to a CentOS apache server. Mod 'puppetlabs/apache', '1.6.0' was successfully applied. The errors suggest that the instance is trying to pick up information from /opt/apache-tomcat-8.0.41 but this is not the install directory I have defined - and does not exist.
Any help greatly appreciated. Regards Ewan

Errors:

Error: /Stage[main]/Profiles::Notify_tomcat/Tomcat::Instance[notify-tomcat8-instance]/Tomcat::Instance::Copy_from_home[/apps/notify/apache-tomcat-8.0.41/conf/catalina.policy]/File[/apps/notify/apache-tomcat-8.0.41/conf/catalina.policy]: Could not evaluate: Could not retrieve information from environment dti020_34 source(s) file:/opt/apache-tomcat/conf/catalina.policy 
Error: /Stage[main]/Profiles::Notify_tomcat/Tomcat::Instance[notify-tomcat8-instance]/Tomcat::Instance::Copy_from_home[/apps/notify/apache-tomcat-8.0.41/conf/context.xml]/File[/apps/notify/apache-tomcat-8.0.41/conf/context.xml]: Could not evaluate: Could not retrieve information from environment dti020_34 source(s) file:/opt/apache-tomcat/conf/context.xml
Error: /Stage[main]/Profiles::Notify_tomcat/Tomcat::Instance[notify-tomcat8-instance]/Tomcat::Instance::Copy_from_home[/apps/notify/apache-tomcat-8.0.41/conf/logging.properties]/File[/apps/notify/apache-tomcat-8.0.41/conf/logging.properties]: Could not evaluate: Could not retrieve information from environment dti020_34 source(s) file:/opt/apache-tomcat/conf/logging.properties Error: /Stage[main]/Profiles::Notify_tomcat/Tomcat::Instance[notify-tomcat8-instance]/Tomcat::Instance::Copy_from_home[/apps/notify/apache-tomcat-8.0.41/conf/server.xml]/File[/apps/notify/apache-tomcat-8.0.41/conf/server.xml]: Could not evaluate: Could not retrieve information from environment dti020_34 source(s) file:/opt/apache-tomcat/conf/server.xml
Error: /Stage[main]/Profiles::Notify_tomcat/Tomcat::Instance[notify-tomcat8-instance]/Tomcat::Instance::Copy_from_home[/apps/notify/apache-tomcat-8.0.41/conf/web.xml]/File[/apps/notify/apache-tomcat-8.0.41/conf/web.xml]: Could not evaluate: Could not retrieve information from environment dti020_34 source(s) file:/opt/apache-tomcat/conf/web.xml

Manifest extract:

  # Install Tomcat using the Forge module.

  $notify_catalina_base = "${notify_install_dir}/apache-tomcat-${notify_tomcat_version}"
  $notify_catalina_home = "${notify_install_dir}/apache-tomcat-${notify_tomcat_version}"

  file { "${notify_install_dir}/apache-tomcat":
    ensure  => link,
    target  => "apache-tomcat-${notify_tomcat_version}",
    require => File["${notify_install_dir}/apache-tomcat-${notify_tomcat_version}"],
  }

  class { '::tomcat':
    user         => $notify_owner,
    group        => $notify_group,
    manage_user  => false,
    manage_group => false,
  }

  ::tomcat::install { '/apps/notify':
    source_url   => "http://archive.apache.org/dist/tomcat/tomcat-${notify_tomcat_major_version}/v${notify_tomcat_version}/bin/apache-tomcat-${notify_tomcat_version}.tar.gz",
  }

  # Configure Tomcat.

  ::tomcat::instance { 'notify-tomcat8-instance':
    catalina_base => $notify_catalina_base,
  }
  ::tomcat::config::server { 'notify-tomcat8-config-server':
    catalina_base => $notify_catalina_base,
    port          => '#removed#',
  }
  # REMOVES the default http connector on port 8080 as this is not used
  ::tomcat::config::server::connector { 'notify-tomcat8-http':
    catalina_base    => $notify_catalina_base,
    port             => '8080',
    protocol         => 'HTTP/1.1',
    connector_ensure => 'absent'
  }
  ::tomcat::config::server::connector { 'notify-tomcat8-ajp':
    catalina_base         => $notify_catalina_base,
    port                  => $notify_ajp_port,
    protocol              => 'AJP/1.3',
    additional_attributes => {
      'proxyPort'            => '443',
      'scheme'               => 'https',
      'tomcatAuthentication' => false,
      'address'              => '127.0.0.1',
      'maxThreads'           => '512',
    },
  }

  ::tomcat::service { 'notify-tomcat8-service':
    catalina_base  => $notify_catalina_base,
    service_ensure => 'running',
  }

  # Remove the default Tomcat webapps.

  file { [
      "${notify_catalina_base}/webapps/docs",
      "${notify_catalina_base}/webapps/examples",
      "${notify_catalina_base}/webapps/host-manager",
      "${notify_catalina_base}/webapps/manager",
      "${notify_catalina_base}/webapps/ROOT",
    ]:
    ensure  => absent,
    recurse => true,
    force   => true,
    purge   => true,
    backup  => false,
    require => Tomcat::Instance['notify-tomcat8-instance'],
  }

  ::tomcat::setenv::entry {'CATALINA_OPTS':
    value       => "\ -Xms256m -Xmx1024m -server -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -verbose:gc -Xloggc:${notify_tomcat_home}/logs/GC.log",
    config_file => "${notify_install_dir}/notify-env-opts",
    require     => Tomcat::Instance['notify-tomcat8-instance'],
  }

}

All relevant file listings below.

2 ...

(more)
edit retag flag offensive close merge delete

Comments

thank you for all the details, however, there are a few more that are needed - namely, what version of puppet are you running and is it opensource or PE?

llowder gravatar imagellowder ( 2017-11-03 06:02:36 -0600 )edit

Version 4.10.8 opensource. Thanks for looking at this. Ewan

ewan59 gravatar imageewan59 ( 2017-11-03 07:03:32 -0600 )edit