I''m using 3 environments in puppet. Each environment points to different IPs and/or hostnames for things ranging from nfs mounts to mail servers, etc. Ideally, I''d like to use the exact same file in each environment, where the IPs/hostnames/etc get called via a variable. Is there a best practice established in terms of where to store such variables? It seems like each node section in nodes.pp is the logical choice, but I suppose it''s also possible to put a case statement at the beginning of each module that assigns the variables based on $environment. I''m curious to see how other people are doing it. johnn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Thu, Sep 11, 2008 at 12:13 PM, Johnny Tan <linuxweb@gmail.com> wrote:> > I''m using 3 environments in puppet. Each environment points > to different IPs and/or hostnames for things ranging from > nfs mounts to mail servers, etc. > > Ideally, I''d like to use the exact same file in each > environment, where the IPs/hostnames/etc get called via a > variable. > > Is there a best practice established in terms of where to > store such variables? It seems like each node section in > nodes.pp is the logical choice, but I suppose it''s also > possible to put a case statement at the beginning of each > module that assigns the variables based on $environment. > > I''m curious to see how other people are doing it.I use the node definition for most of that stuff. The main differecne in my enviroments is that I expect production to work. and I use development for doing just that. Evan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Sep 11, 1:13 pm, Johnny Tan <linux...@gmail.com> wrote:> I''m using 3 environments in puppet. Each environment points > to different IPs and/or hostnames for things ranging from > nfs mounts to mail servers, etc. > > Ideally, I''d like to use the exact same file in each > environment, where the IPs/hostnames/etc get called via a > variable. > > Is there a best practice established in terms of where to > store such variables? It seems like each node section in > nodes.pp is the logical choice, but I suppose it''s also > possible to put a case statement at the beginning of each > module that assigns the variables based on $environment.I am probably way off base here but I wanted to do something similar (I think) although I''m not using environments, yet. I have multiple types of hardware (1U rack & small desktop box) that I want to manage with the same set of files. However the only way I can tell them apart is by hostname; factor doesn''t really have any way to distinguish between the hardware. So what I did was create a GLOBAL module with a single init.pp and contents like this: class GLOBAL { $NODE_TYPE = $NOTE_TYPE $MANUFACTURER = "Dell" } Then in my node definition I set the variable $NODE_TYPE to something "desktop" and then include GLOBAL. Now I can reference $NODE_TYPE in any of my modules. For example, I''m installing a specific /etc/ modules with the following file { source => "common/etc/modules. $NODE_TYPE" }. All this juggling is necessary because of the scope of Puppet variables and the fact that it doesn''t have global variables. Does this help? Is there a better way to do this? Am I totally off base here? Thanx! Richard --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 9/12/2008 11:40 AM, Richard wrote:> I am probably way off base here but I wanted to do something similar > (I think) although I''m not using environments, yet. I have multiple > types of hardware (1U rack & small desktop box) that I want to manage > with the same set of files. However the only way I can tell them > apart is by hostname; factor doesn''t really have any way to > distinguish between the hardware.I think it might, actually. Not sure how it''s getting it, but here''s an abridged paste from one of my older Ubuntu workstations that appears to include manufacturer, model, and even the service tag or some other serial number: # facter architecture => i386 debianversion => etch domain => cae.tntech.edu facterversion => 1.3.8 ... kernel => Linux kernelrelease => 2.6.20-16-generic lsbdistcodename => feisty lsbdistdescription => Ubuntu 7.04 lsbdistid => Ubuntu lsbdistrelease => 7.04 ... manufacturer => Dell Computer Corporation memoryfree => 845.25 MB memorysize => 1010.98 MB operatingsystem => Debian operatingsystemrelease => 2.6.20-16-generic processor0 => Intel(R) Xeon(TM) CPU 1.80GHz processor1 => Intel(R) Xeon(TM) CPU 1.80GHz processorcount => 2 productname => Precision WorkStation 530 MT ps => ps -ef puppetversion => 0.23.2 rubysitedir => /usr/local/lib/site_ruby/1.8 rubyversion => 1.8.5 serialnumber => H0SNB11 ... -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Sep 12, 2008, at 1:14 PM, Mike Renfro wrote:> > On 9/12/2008 11:40 AM, Richard wrote: > >> I am probably way off base here but I wanted to do something similar >> (I think) although I''m not using environments, yet. I have multiple >> types of hardware (1U rack & small desktop box) that I want to manage >> with the same set of files. However the only way I can tell them >> apart is by hostname; factor doesn''t really have any way to >> distinguish between the hardware. > > I think it might, actually. Not sure how it''s getting it, but here''s > an > abridged paste from one of my older Ubuntu workstations that appears > to > include manufacturer, model, and even the service tag or some other > serial number: >It''s getting that information from the BIOS, using dmidecode. If you have hosts that don''t include that information in their facter output, make sure you have dmidecode installed on them... -- Jason Kohles, RHCA RHCDS RHCE email@jasonkohles.com - http://www.jasonkohles.com/ "A witty saying proves nothing." -- Voltaire --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
in facter older than 1.5 some systems (like rh< 5) dmidecode facts will not be parsed correctly. you could add more facts easily in the manufacture.rb file Ohad On Sat, Sep 13, 2008 at 1:56 AM, Jason Kohles <jasonkohles@gmail.com> wrote:> > On Sep 12, 2008, at 1:14 PM, Mike Renfro wrote: > > > > > On 9/12/2008 11:40 AM, Richard wrote: > > > >> I am probably way off base here but I wanted to do something similar > >> (I think) although I''m not using environments, yet. I have multiple > >> types of hardware (1U rack & small desktop box) that I want to manage > >> with the same set of files. However the only way I can tell them > >> apart is by hostname; factor doesn''t really have any way to > >> distinguish between the hardware. > > > > I think it might, actually. Not sure how it''s getting it, but here''s > > an > > abridged paste from one of my older Ubuntu workstations that appears > > to > > include manufacturer, model, and even the service tag or some other > > serial number: > > > > It''s getting that information from the BIOS, using dmidecode. If you > have hosts that don''t include that information in their facter output, > make sure you have dmidecode installed on them... > > -- > Jason Kohles, RHCA RHCDS RHCE > email@jasonkohles.com - http://www.jasonkohles.com/ > "A witty saying proves nothing." -- Voltaire > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Sep 12, 1:14 pm, Mike Renfro <ren...@tntech.edu> wrote:> On 9/12/2008 11:40 AM, Richard wrote: > > > I am probably way off base here but I wanted to do something similar > > (I think) although I''m not using environments, yet. I have multiple > > types of hardware (1U rack & small desktop box) that I want to manage > > with the same set of files. However the only way I can tell them > > apart is by hostname; factor doesn''t really have any way to > > distinguish between the hardware. > > I think it might, actually. Not sure how it''s getting it, but here''s an > abridged paste from one of my older Ubuntu workstations that appears to > include manufacturer, model, and even the service tag or some other > serial number:Tha''ts good information to know, I hadn''t heard of dmidecode before. Unfortunately, it wont work on some of my systems. I get a "# No SMBIOS nor DMI entry point found, sorry." error when I run it. Back to the drawing board... Later... Richard --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---