Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add a workaround for duplicate class definitions #42

Closed
wants to merge 1 commit into from

2 participants

@kronn

As the automatic dependency resolution did not work properly, I needed to include the pre- and post-dependencies into my manifests.

The resulting "duplicate definition" error needs a safeguard, which I added.

I don't know how to solve the underlying issue of the broken dependency resolution.

I use puppet 2.7.1 and cucumber-puppet 0.3.8. The failure occured in my tests...

@blt04
Owner

Interesting. Could you post the relavent portions of your manifest files? I haven't seen this problem before. I'd much rather address the underlying problems with dependency resolution.

@kronn

I can try to make a minimal example with this issue.

I remember warnings about require being not supported in older clients (which I ignored, because all agents and the master are puppet 2.7.1). this warning included something about loading the code but not adding a dependency. In an earlier commit of puppet-rvm, everything worked fine. After updating (because rvm changed it's installation method) the passenger-dependencies were not installed.

the manifests I have are very layered:

the node which has/should have the webserver installed, has
class { 'actual_app::webserver': ... }

the actual_app/webserver.pp calls
class { 'rails::webserver': ...}

rails/webserver.pp contains
class { 'rvm::passenger::apache': ... }

All machines involved are running Ubuntu 11.10 (which also explains the version of puppet I use).

@kronn

One more interesting thing: While running the cucumber test, I get the following warning:

warning: Scope(Class[Rvm::Dependencies]): 
The 'require' function is only compatible with clients at 0.25 and above; 
including class but not adding dependency

according to the docs, the dependecy should be added in puppet 2.7.1 (which I use).

Any idea how to tackle this one?

@kronn

I am closing this one and reopen one with only this commit.

Bad me for not using topic-branches in the first place.

@kronn kronn closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 30, 2012
  1. @kronn
This page is out of date. Refresh to see the latest.
Showing with 26 additions and 22 deletions.
  1. +26 −22 manifests/passenger/apache.pp
View
48 manifests/passenger/apache.pp
@@ -28,31 +28,35 @@
case $operatingsystem {
Ubuntu: {
- class { 'rvm::passenger::apache::ubuntu::post':
- ruby_version => $ruby_version,
- version => $version,
- rvm_prefix => $rvm_prefix,
- mininstances => $mininstances,
- maxpoolsize => $maxpoolsize,
- poolidletime => $poolidletime,
- maxinstancesperapp => $maxinstancesperapp,
- spawnmethod => $spawnmethod,
- gempath => $gempath,
- binpath => $binpath;
+ if !defined(Class['rvm::passenger::apache::ubuntu::post']) {
+ class { 'rvm::passenger::apache::ubuntu::post':
+ ruby_version => $ruby_version,
+ version => $version,
+ rvm_prefix => $rvm_prefix,
+ mininstances => $mininstances,
+ maxpoolsize => $maxpoolsize,
+ poolidletime => $poolidletime,
+ maxinstancesperapp => $maxinstancesperapp,
+ spawnmethod => $spawnmethod,
+ gempath => $gempath,
+ binpath => $binpath;
+ }
}
}
CentOS,RedHat: {
- class { 'rvm::passenger::apache::centos::post':
- ruby_version => $ruby_version,
- version => $version,
- rvm_prefix => $rvm_prefix,
- mininstances => $mininstances,
- maxpoolsize => $maxpoolsize,
- poolidletime => $poolidletime,
- maxinstancesperapp => $maxinstancesperapp,
- spawnmethod => $spawnmethod,
- gempath => $gempath,
- binpath => $binpath;
+ if !defined(Class['rvm::passenger::apache::centos::post']) {
+ class { 'rvm::passenger::apache::centos::post':
+ ruby_version => $ruby_version,
+ version => $version,
+ rvm_prefix => $rvm_prefix,
+ mininstances => $mininstances,
+ maxpoolsize => $maxpoolsize,
+ poolidletime => $poolidletime,
+ maxinstancesperapp => $maxinstancesperapp,
+ spawnmethod => $spawnmethod,
+ gempath => $gempath,
+ binpath => $binpath;
+ }
}
}
}
Something went wrong with that request. Please try again.