简体   繁体   中英

Puppet dependency

I'm misunderstanding something about puppet, but I'm having trouble formulating it well enough to succeed at searching for it.

I have some hosts that run rails. So I have a puppet module that sets up such hosts.

class rails_server {
  ...
}

And I have some hosts that know how to deploy to rails servers, do tests on rails services, etc.

class rails_deployment {
  ...
}

And both of them depend on having certain gems installed, a certain ruby version,etc.

class rails_dependencies {
  class { '::rvm': }
  rvm_system_ruby { ... }
  rvm_gem { ... }
}

But this seems a bit of kludge, because in my site.pp , I have to state explicitly that I want rails_dependencies installed. But if instead I have rails_server and rails_deployment both include rails_dependencies , and then try to bring up a test host that can run the server and test and deploy to itself, I get a duplicate declaration error.

It's hard to answer the question without more example code. Using include will prevent duplicate declarations of the same class, so it's probably somewhere else?

Pasting the error and the lines of code it refers to would be helpful

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM