Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tomcat7 deployment won't work on RHEL 6 #9

Open
predicador37 opened this issue Mar 31, 2015 · 10 comments
Open

tomcat7 deployment won't work on RHEL 6 #9

predicador37 opened this issue Mar 31, 2015 · 10 comments

Comments

@predicador37
Copy link

I'm having a new and weird problem with tomcat7 deployment on rhel/centos6. I'm testing a configuration on a pair of rhel machines. This configuration worked before. Now, I've got a lot of errors:

    [Notice: /Stage[main]/Profile::Apache_tomcat/Tomcat::Server[data]/Tomcat::Server::Install[data]/Exec[change provider in /etc/init.d/tomcat-data]: DependencyFile[/etc/init.d/tomcat-data] has failures: true]

    [Debug: /Stage[main]/Tomcat/File[/etc/sysconfig/tomcat]: Nothing to manage: no ensure and the resource doesn't exist

I'm trying a multi-instance configuration with a service called 'data'. Also, no tomcat7 package is installed...

Any ideas?

@lbetz
Copy link
Owner

lbetz commented Apr 1, 2015

Please send me your puppet code.

Am 31.03.2015 um 22:38 schrieb Miguel Expósito [email protected]:

I have a new and weird problem with tomcat7 deployment on rhel/centos6. I'm testing a configuration on a pair of rhel machines. This configuration worked before. Now, I've got a lot of errors:

[mNotice: /Stage[main]/Profile::Apache_tomcat/Tomcat::Server[data]/Tomcat::Ser

ver::Install[data]/Exec[change provider in /etc/init.d/tomcat-data]: Dependency
File[/etc/init.d/tomcat-data] has failures: true]

I'm trying a multi-instance configuration with a service called 'data'. Also, no tomcat7 package is installed...

Any ideas?


Reply to this email directly or view it on GitHub.

@predicador37
Copy link
Author

Sure. This is the hiera data:

    tomcat::ensure: 'stopped'
    tomcat::enable: false
    tomcat::version: '7'
    tomcat_server:
      data:
        ensure: 'running'
        enable: true
        port: '8104'
        setenv:
          - 'ADD_JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses"'
        services:
          Catalina:
            connectors:
              http-8084:
                port: '8084'
                protocol: 'HTTP/1.1'
              ajp-8014:
                port: '8014'
                protocol: 'AJP/1.3'
        listeners:
           org.apache.catalina.core.AprLifecycleListener:
              ssl_engine: 'On'
           org.apache.catalina.core.JasperListener: {}
           org.apache.catalina.core.JreMemoryLeakPreventionListener: {}
           org.apache.catalina.mbeans.GlobalResourcesLifecycleListener: {}
           org.apache.catalina.core.ThreadLocalLeakPreventionListener: {}
      metadata:
        ensure: 'running'
        port: '8105'
        setenv:
          - 'ADD_JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses"'
        services:
          Catalina:
            connectors:
              http-8085:
                port: '8085'
                protocol: 'HTTP/1.1'
              ajp-8015:
                port: '8015'
                protocol: 'AJP/1.3'
        listeners:
           org.apache.catalina.core.AprLifecycleListener:
              ssl_engine: 'On'
           org.apache.catalina.core.JasperListener: {}
           org.apache.catalina.core.JreMemoryLeakPreventionListener: {}
           org.apache.catalina.mbeans.GlobalResourcesLifecycleListener: {}
           org.apache.catalina.core.ThreadLocalLeakPreventionListener: {}

Then I have a role-profile architecture. Relevant code that has to do with Tomcat:

class profile::apache_tomcat {
require tomcat
$tomcat_server = hiera('tomcat_server', {})
create_resources('tomcat::server', $tomcat_server)
}

And:

class role::appserver inherits role {

class{'profile::rhel':} ->
class{'profile::jdk':} ->
class{'profile::apache_tomcat':}
}

Profiles rhel and jdk contains EPEL repository and java open-jdk-1.7 respectively.

@lbetz
Copy link
Owner

lbetz commented Apr 1, 2015

I tried your configuration and works fine on my centos6 with branch master and next. Maybe some more input of your errors helps?

@predicador37
Copy link
Author

I get no more relevant errors; not even enabling debugging.
I've tried to use master from github instead of puppet forge module, but same results. I've managed to get rid of some errors by installing tomcat package manually. Other errors appear:

    Error: /Stage[main]/Profile::Apache_tomcat/Tomcat::Server[data]/Tomcat::Server::Config[data]/Concat[/var/tomcat/data/conf/server.xml]/File[/var/tomcat/data/conf/server.xml]: Could not evaluate: could not retrieve information from environment production source(s) file:/var/lib/puppet/concat/_var_tomcat_data_conf_server.xml/fragments.concat.out

I think there is some kind of problem with yum or repos, because tomcat package does not get installed. I think I'll try with a new and blank VM...

@lbetz
Copy link
Owner

lbetz commented Apr 2, 2015

That sounds good. let me know your result of the test.

Am 02.04.2015 um 09:20 schrieb Miguel Expósito [email protected]:

I get no more relevant errors; not even enabling debugging.
I've tried to use master from github instead of puppet forge module, but same results. I've managed to get rid of some errors by installing tomcat package manually. Other errors appear:

Error: /Stage[main]/Profile::Apache_tomcat/Tomcat::Server[data]/Tomcat::Server::Config[data]/Concat[/var/tomcat/data/conf/server.xml]/File[/var/tomcat/data/conf/server.xml]: Could not evaluate: could not retrieve information from environment production source(s) file:/var/lib/puppet/concat/_var_tomcat_data_conf_server.xml/fragments.concat.out

I think there is some kind of problem with yum or repos, because tomcat package does not get installed. I think I'll try with a new and blank VM...


Reply to this email directly or view it on GitHub.

@predicador37
Copy link
Author

I've tried with a blank Centos 6.5 VM with same results. It seems like puppet is trying to install tomcat package first, no matter what. Since EPEL repository is not installed yet, the tomcat package cannot be installed and the error appears. I've tried all kind of precedence operators, leaving tomcat class for last, but with no success. In fact, these are the lines of code which trigger the tomcat package installation:

  $tomcat_server = hiera('tomcat_server', {})
  create_resources('tomcat::server', $tomcat_server)

This lines are contained in the profile::apache_tomcat class, which is contained in the role::appserver class, this way:

  class role::appserver inherits role {

     class{'profile::rhel':}

     class{'profile::jdk':
        require => Class['profile::rhel']
     }

     class{'profile::apache_tomcat':
       require => Class['profile::jdk']
    }
 }

The code contained in rhel and jdk classes is never executed before the tomcat package installation.

Have you tried this without EPEL repository installed? I'm running out of ideas...

@lbetz
Copy link
Owner

lbetz commented Apr 8, 2015

I will try to have a look on this problem in the evening.

Am 07.04.2015 um 19:59 schrieb Miguel Expósito [email protected]:

I've tried with a blank Centos 6.5 VM with same results. It seems like puppet is trying to install tomcat package first, no matter what. Since EPEL repository is not installed yet, the tomcat package cannot be installed and the error appears. I've tried all kinds of precedence operators, leaving tomcat class for last, but with no success. In fact, these are the lines of code which trigger the tomcat package installation:

$tomcat_server = hiera('tomcat_server', {})
create_resources('tomcat::server', $tomcat_server)

This lines are contained in the profile::apache_tomcat class, which is contained in the role::appserver class, this way:

class role::appserver inherits role {

 class{'profile::rhel':}

 class{'profile::jdk':
    require => Class['profile::rhel']
 }

 class{'profile::apache_tomcat':
   require => Class['profile::jdk']
}

}

The code contained in rhel and jdk classes is never executed before the tomcat package installation.

Have you tried this without EPEL repository installed? I'm running out of ideas...


Reply to this email directly or view it on GitHub.

@lbetz
Copy link
Owner

lbetz commented Apr 8, 2015

If you declare your repositories with puppet and use before => Class['tomcat'] then the problem is, that I use the anchor behind the install class/define resource, like:

tomcat::server::install { $title:
  user  => $_user,
  group => $_group,
}
-> anchor { "tomcat::server::${title}::begin":
  notify => Tomcat::Server::Service[$title],
}
-> tomcat::server::initialize { $title:

The reason was, I wanna have the directories installed and wanna use i.e. for external file like war files:

file { '/var/tomcat/webapp/test.war':
ensure => file,
...
notify => Class['tomcat']
}

I will think about this part of code in the evening.

@lbetz
Copy link
Owner

lbetz commented Apr 8, 2015

What works, use a stage for declaring repos or the collector like
Yumrepo['epel'] -> Package <| |>

@predicador37
Copy link
Author

I've made a dependency graph (file attached) and added some notifications. The result is that Tomcat::Install class depends directly on the main stage, as can be seen in the graph.

Perhaps adding a stage for yum repo will work, but order cannot be applied to this module anyway... I'm not sure if this is a desirable behaviour.

screenshot_112020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants