Marcello de Sousa wrote:
I've been trying to use a resolv_conf recipe to setup the DNS servers based
on $domain and $location (a custom fact).
So I cascade the 2 conditionals, but it's not working. Is it supposed to
work ? Or should I look for an alternative ?
------------------------------------------
    resolv_conf { "location_based_resolv":
        domainname  => "$domain",
        searchpath  => [$domain],
# Here is the cascaded conditional. If I'm in "domain1" I want to test 3
different locations.
        nameservers => $domain ? {
           "domain1.local" => $location ? {
                "Default-First-Site-Name" =>  ['10.2.38.10','10.128.38.21'],
                "HeadOffice"              =>
['10.128.36.20','10.128.36.11'],
                default                   =>  ['10.128.36.10','10.2.36.21'],
                                          }
           "domain2.local" =>  ['10.128.36.20','10.128.36.10'],
           default         =>  ['10.128.36.10','10.2.36.20'],
                                 }
                }
------------------------------------------
## If I test only one level it works:
#        nameservers => $location ? {
#               "Default-First-Site-Name" =>  ['10.2.38.10','10.128.38.21'],
#               "HeadOffice"              =>
['10.128.36.20','10.128.36.11'],
#               default                   =>  ['10.128.36.10','10.2.36.21'],
#                                 }
------------------------------------------

Am I missing something ? Or should I do it differently ?

Cheers,
Marcello



The goggles! They do *nothing*!

Please check out RI Pienaar's extlookup utility over at devco.net. This can be shortened to have no conditionals and the data can be grabbed via location-specific csv files.

It's also worth mentioning that any language features can be tested by writing a .pp file and running:

puppet --parseonly whatever.pp

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@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.

Reply via email to