On Mon, 15 Feb 2010, 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 ?
Nested selectors are supposed to work. I think you have some missing
commas:
> 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'],
> }
Missing comma here ---------------------^
> "domain2.local" => ['10.128.36.20','10.128.36.10'],
> default => ['10.128.36.10','10.2.36.20'],
> }
I'd put a comma here ----------^
but it's not essential, because this is the last attribute
in the resource.
> }
--apb (Alan Barrett)
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.