Hi, I like to allow my systems to define what services they are running, rather than puppet making that decision (based upon something like the hostname). So I''ve written the attached module to create facts based upon files in a particular directory ("/.facter"). The fact names are the filenames in /.facter and their values are the first line of the file. Unfortunately I don''t know ruby well enough to do any sanitizing on the filename (making sure that it''s a valid fact name) - that''ll be in the next release. :-) ...dave -- Dave Alden The Ohio State University Department of Mathematics _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Hi, Oops - that''ll teach me to not fully test a module after making a "minor" change. :-) This included module actually works as previously described. I''ve also gone ahead and added code that makes sure that the filename only contains word characters ( [0-9A-Za-z_] ). ...dave -- Dave Alden The Ohio State University Department of Mathematics _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Dave, This sounds like it might solve a problem I''ve been contemplating. I have multiple, identical version of systems scattered around the world. I don''t want to name each of them but would rather put them into some sort of class - small server, medium server, large server. Would this allow me to designate 50 machines as "small" and handle them with one node; even if they had different host names? If so, give me some more info on how to use include and I''ll give it a go. I''m kinda new around here and don''t know if I''m supposed to put it on the master or on each client? Thanx! Richard On Feb 20, 2008 10:04 AM, Dave Alden <alden@math.ohio-state.edu> wrote:> Hi, > Oops - that''ll teach me to not fully test a module after making a "minor" > change. :-) This included module actually works as previously described. > I''ve also gone ahead and added code that makes sure that the filename only > contains word characters ( [0-9A-Za-z_] ). > ...dave > -- > Dave Alden > The Ohio State University > Department of Mathematics > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users > >_______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Hi, On Wed, Feb 20, 2008 at 12:30:57PM -0500, Richard Hurt wrote:> This sounds like it might solve a problem I''ve been contemplating. I have > multiple, identical version of systems scattered around the world. I don''t > want to name each of them but would rather put them into some sort of class > - small server, medium server, large server. Would this allow me to > designate 50 machines as "small" and handle them with one node; even if they > had different host names? If so, give me some more info on how to use > include and I''ll give it a go. I''m kinda new around here and don''t know if > I''m supposed to put it on the master or on each client?Yes. You could create a file on each host called /.facter/hosttype that contains either ''small'', ''medium'' or ''large''. Then when facter runs it would define the fact ''hosttype'' to be ''small'', ''medium'' or ''large'' (which you could use inside of puppet to "do the right thing"). As far as the module, it needs to be on all of the clients. How you distribute this module will depend on what version of puppet you''re running. If you''re running 0.23.2, see: http://reductivelabs.com/trac/puppet/wiki/AddingFacts If you''re running 0.24.x, see: http://reductivelabs.com/trac/puppet/wiki/PluginsInModules (I''m running 0.23.2, so I''m using the AddingFacts page - feel free to ask me if you are too and run into any problems). One other thing, you''ll want to set root''s FACTERLIB environment variable to point to the directory where the fact module gets installed. For example (assuming you''re running a sh variant), the default in 0.23.2 would be: FACTERLIB=/var/lib/puppet/facts; export FACTERLIB This way when you run facter by hand, you''ll get the "additional" facts. ...dave -- Dave Alden The Ohio State University Department of Mathematics