Hi, I get the serialnumber from my system through "facter | grep serialnumber"
Also this is possible whether puppet picks the serialnumber fact instead of hostname fact from the nodes. Can you provide the serialnumber.rb fact syntax Thanks On Sun, Apr 8, 2012 at 2:32 PM, John Kennedy <skeb...@gmail.com> wrote: > No one should be able to change the hostname through the fact (they can > override any fact for a one time occurrance but that is not a pernanent > change) > As to how you can get a serialnumber fact, we would need to know how you > get the serial number from your system to begin with. Then you write the > fact around that. You then put your rb file in with all the other fact rb > files and puppet will find it. > John > > John Kennedy > > > > > On Sat, Apr 7, 2012 at 11:17, Mukul Malhotra <smilemukul2...@gmail.com>wrote: > >> >> Hi, >> >> Actually I want that nobody in my network can change the hostname as some >> has already changed the hostname of their node so >> I want to restrict a check that nobody in the network or outside network >> can change the hostname as they are already provided the sudo access as per >> requirement. Also all the nodes in the network are configured with >> serialnumber. >> >> Can you elaborate more that how "serialnumber" custom fact can be written >> & the same will be loaded through puppet for every node in the network. >> >> Thanks >> mac01 >> >> >> **** >> >> On Thu, Apr 5, 2012 at 6:47 PM, jcbollinger <john.bollin...@stjude.org> >> wrote:**** >> >> >> >> On Apr 5, 1:39 am, mac01 <smilemukul2...@gmail.com> wrote: >> > Hi, >> >**** >> >> > I am trying to override a hostname.rp from path: * >> > /usr/lib/ruby/site_ruby/1.8/facter* as,**** >> >> > >> > Facter.add(:hostname) do >> > confine :hostname => "serialnumber" >> > setcode do >> > Facter::Util::Resolution.exec('cat /sys/power/states') >> > end >> > end >> > >> > Is the fact code correct as I want puppet to pick serialnumber instead >> of hostname from facter ? >> >> **** >> >> You are trying to confine the 'hostname' fact based on the value of >> that same fact. I don't see how that could possibly work. Either it >> will throw Facter into an infinite loop, or that version of the fact >> will just never be chosen. >> >> There is probably a better approach to your problem than redefining >> the hostname fact. Not knowing what your actual problem is, I can >> only speculate, but you might be better off creating and using a >> "serialnumber" custom fact. You might also want to look into Puppet's >> "certname" parameter. >> >> >> John**** >> >> >> -- >> 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+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en.**** >> >> ** ** >> >> ------------------------------ >> Email Disclaimer: www.stjude.org/emaildisclaimer >> >> -- >> 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+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en. >> > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.