简体   繁体   中英

How should I structure my puppet configurations for shared environment resources (packages, configurations, etc) when using Puppet?

So I'm setting up puppet for a project I'm working on and I wanted to know what the best way to share resources between environments is. The problem is that I have a number of common packages that I want installed between a few different environments.

I read up on puppets support for environments and it looked like all you can do is specify the module path and the manifest. If that's the case, then what is even the point of environments?

What I'm thinking about doing is just having a shared module path that has a module with the shared packages to install and then importing that into each environment's site manifest, but that just seems like a hacky way of doing it especially when modules are supposed to be stand alone.

Is there a better way to implement this? Am I missing something?

Thanks.

You may use node to configure different environment:

# /etc/puppetlabs/puppet/manifests/site.pp
node 'dev' {
  include common
  include apache
  include squid
}
node 'prod' {
  include common
  include mysql
}

Here's a reference: http://docs.puppetlabs.com/puppet/2.7/reference/lang_node_definitions.html

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