Gang,

I've got a question regarding how facter works, specifically the  
domain fact:

we're using a NIS domain name (mpklab.sfbay.sun.com) which differs  
from the DNS domain name (sfbay.sun.com), and it screws with the  
certificate names. So I thought I would just add a dnsdomainname  
script which chops off the mpklab part, but the setcode part doesn't  
get executed.

I've added debug output to verify that only the setcode section for  
trying the "domainname" command is executed:

---8<---
# Look for the DNS domain name command first.
Facter.add(:domain) do
     $stderr.puts "trying dnsdomainname"
     setcode do
         domain = Facter::Util::Resolution.exec('dnsdomainname') or nil
         $stderr.puts "dnsdomainname = #{domain}"
         # make sure it's a real domain
         if domain and domain =~ /.+\..+/
             domain
         else
             nil
         end
     end
end
Facter.add(:domain) do
     $stderr.puts "trying domainname"
     setcode do
         domain = Facter::Util::Resolution.exec('domainname') or nil
         $stderr.puts "domainname = #{domain}"
         # make sure it's a real domain
         if domain and domain =~ /.+\..+/
             domain
         else
             nil
         end
     end
end
---8<---

This results in the following output:
trying hostname
trying dnsdomainname
trying domainname
trying resolv.conf
domain = mpklab.sfbay.sun.com
mpklab.sfbay.sun.com

Can anyone enlighten me why it skips the dnsdomainname setcode block?

cheers,
/Martin
-- 
Martin Englund, Security Engineer, .Sun Engineering, Sun Microsystems  
Inc.
Email: [EMAIL PROTECTED]  Time Zone: GMT+1  PGP: 1024D/AA514677
"The question is not if you are paranoid, it is if you are paranoid  
enough."






--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to