From: ara.t.howard@... Date: 2006-11-17T07:38:13+09:00 Subject: Re: finding which OS? On Fri, 17 Nov 2006, Luke Kanies wrote: >> can you explain that? custom .to_s? > > Facter is meant to be a collection of mechanisms for retrieving a named > piece of data; e.g., 'uname -s' is the most common way of retrieving the > operating system name, but it's useless on any Linux distro so instead I > look for /etc/redhat-release or use lsbrelease. Thus, it's pretty easy to > think of Facter as a big hash, but instead of simple values it has one or > more ways of retrieving each value. > > So, I just implemented to_hash as a way of returning all known facts and > their values. > > I'm skipping any fact that matches /key/ here because Facter knows how to > retrieve SSH keys, which are huge and would have polluted the output. I had > to pick between confusing people by skipping those values, or confusing > people by including them. :) okay - it makes perfect sense then > >> seems like you should be able to do >> >> y Facter.table('key') # or :key >> >> for similar effect, or some such > > What would be the intent of that? pls ignore - in light of above explanation... > I originally wrote it a few years ago as an inventorying mechanism -- > there's a simple tool[1] that stores these facts into LDAP -- but now Puppet > uses it heavily. Every time a Puppet client connects to the server, it > collects all of its known facts and passes them to the server as a hash. > The server then sets these facts as variables in the top-level scope. Thus, > you can use $operatingsystem or $ipaddress in your Puppet configurations and > use this data to make decisions in your configuratin. well, i happen to be working on resource requests for ruby queue, eg rq queue submit --requirements="cpu > 3.0mhz and mem > 64gb" -- job.rb so you can see what's applealing about it! cheers. -a -- my religion is very simple. my religion is kindness. -- the dalai lama