Jed
2011-Feb-08 16:54 UTC
[Puppet Users] puppet manifests/classes broken down by environment/domain (ie. dev/stg/prod)
Hi All, Trying to wrap my head around this... I want to have a bank of puppet servers that will be be fronted by a load balancer(anything such as apache proxy, or passenger..etc), these server banks will be the puppet masters for our internal dev/stg/prod environments/servers, as well as our EC2 cloud instances so i will have 4 total separate environments... As my first task/project - I am trying to puppetize our Nagios server environments. I''ve build custom .rpm''s to handle the installation/setup as much as possible and then have puppet handle the remaining config/setups that the rpm could not do(probably could, but would be to much work). the core question i have here is that our nagios server in dev has different config files then our nagios server in prod ( ie. apache conf.d, etc..) How can i have puppet recognize the different environments and deploy designated config bases on the identified environment. possibly by domain, since our structure is as follows -- even if I went this route - i still am at the roadblock of how do I setup puppet to do this.... From what i gather, all the nagios servers across all the domain would get the nagios rpms i''ve built using puppet, and then i would have all the custom config file sitting on the puppet masters repo(puppet master local file system). poller1.qprvt.tech.com would get abc configs which are designated as dev config files for nagios poller1.sprvt.tech.com would get xyz configs which are designated as staging config files for nagios etc... etc... dev = qprvt.tech.com stg = sprvt,tech.com prod = prvt.tech.com ec2 = ec2.tech.com sorry for the long winded messages.... just trying to convey my thoughts... Thanks for all the help guy/gals -- i''m very excited about puppet -- but its proving elusive to nail down(at least for me at the moment). -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
luke.bigum
2011-Feb-08 17:12 UTC
[Puppet Users] Re: puppet manifests/classes broken down by environment/domain (ie. dev/stg/prod)
Hi Jed, On Feb 8, 4:54 pm, Jed <jedbl...@gmail.com> wrote:> Hi All, > > I want to have a bank of puppet servers that will be be fronted by a > load balancer(anything such as apache proxy, or passenger..etc), these > server banks will be the puppet masters for our internal dev/stg/prod > environments/servers, as well as our EC2 cloud instances > > so i will have 4 total separate environments...I have a Puppet Master cluster load balanced using ldirectord (search for posts by me from about a month ago). There was also a very detailed post on how to achieve the balancing with Apache / Passenger recently (2-3 weeks ago).> the core question i have here is that our nagios server in dev has > different config files then our nagios server in prod ( ie. apache > conf.d, etc..) > How can i have puppet recognize the different environments and deploy > designated config bases on the identified environment.Environments have separate ''manifest'' and ''modulepath'', so use separate site.pp and modules for each environment you have. This will result in a lot of replicated data, but it will give you perfect segregation between Dev and Prod. For example in my own environment: /etc/puppet/puppet.conf: ... [production] manifest = /etc/puppet/conf/production/manifests/site.pp modulepath = /etc/puppet/conf/production/modules [development] manifest = /etc/puppet/conf/development/manifests/site.pp modulepath = /etc/puppet/conf/development/modules For 99% of my modules, the Dev tree is exactly the same as the Prod tree, however if I want to test a change like a new module, or modify a configuration file, I can just modify the Dev tree''s files and copy them to Production when they pass testing. For your example, managing Nagios, lets say you have a Puppet module called ''nagios'' you''d have a file system like: development/modules/nagios/manifests/init.pp development/modules/nagios/files/somefile production/modules/nagios/manifests/init.pp production/modules/nagios/files/somefile When you''ve got something like this in a class: file { "/etc/nagios/somefile": source => "puppet:///modules/nagios/somefile", } The "somefile" file will come from a the Dev module when your Puppet clients runs with "environment = development", and from your Prod module when "environment = production". Some people use multiple check outs of the one SVN check out, some use physically separate trees and rsync between to migrate changes from Dev -> Staging -> Prod. The second way sounds like it''d suit you better as your Dev and Prod are different a lot of the time. Hope that helps, -Luke> possibly by domain, since our structure is as follows -- even if I > went this route - i still am at the roadblock of how do I setup puppet > to do this.... > > From what i gather, all the nagios servers across all the domain would > get the nagios rpms i''ve built using puppet, and then i would have all > the custom config file sitting on the puppet masters repo(puppet > master local file system). > > poller1.qprvt.tech.com would get abc configs which are designated as > dev config files for nagios > poller1.sprvt.tech.com would get xyz configs which are designated as > staging config files for nagios > etc... > etc... > > dev = qprvt.tech.com > stg = sprvt,tech.com > prod = prvt.tech.com > ec2 = ec2.tech.com > > sorry for the long winded messages.... just trying to convey my > thoughts... > > Thanks for all the help guy/gals -- i''m very excited about puppet -- > but its proving elusive to nail down(at least for me at the moment).-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.