I found it easier to create a detector based recipe which applied usable variables/arrays then passed them down into a template.

Sent from my iPhone

On Feb 16, 2010, at 7:05 AM, Trevor Vaughan <tvaug...@onyxpoint.com> wrote:

I haven't tried it that way, but it would seem that that wouldn't work to me.

It does work with nested if/else statements.

Trevor

On Mon, Feb 15, 2010 at 4:12 PM, Marcello de Sousa <li...@area151.com> 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



--
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 .





--
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvaug...@onyxpoint.com

-- This account not approved for unencrypted proprietary information --

--
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 .


--
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