linuxdatacenter <linuxdatacen...@gmail.com> writes: > Yeah - ntpd was just a dumb example - of course you can do it this way ;-). > > But for more sophisticated puppet setups - what are your ways to determine > which environment you are in.
I wrote a custom fact, location, that embeds all the logic in a tiny bit of custom Ruby. (In fact, it just grabs the hostname, domain, and IP address, then uses a tiny bit of logic to select between them.) Then, all my puppet code can use $location to work with things like location-specific settings, and I have a single fact to update if the rules ever get more complicated. (In fact, the hostname is only used because the *did* get more complicated when users demanded a machine "location" become logical, since a system at the second site should act like it was part of the first. Oh, well. :) > I know puppet can manage different environments at one time (each with its > own set of modules and files - you configure puppetmaster for this), but > this AFAIK requires you to maintain multiple instances of your modules and > classes. Yeah, this isn't about "environments" in that sense, but rather another fact about the machine that you use to build your configuration. Daniel -- ✣ Daniel Pittman ✉ dan...@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.