Here's how I do it...

In my nodes.pp, I define certain global variables at the top of the
manifest, outside of any node definitions.  If I want to override a
default variable, I redefine the variable inside of the specific node
definition, before I include the class that uses the variable.

For example:
> cat nodes.pp
# defaults
$dnsname = "foo.local"
$dnsserver = [ "192.168.1.1", "192.168.2.1" ]
$dnssearchpath = [ "foo", "foo.local" ]

node "standard.node" {
    include basenode
}

node "nonstandard.node" {
    $dnsname = "bar.local"
    $dnsserver = [ "192.168.100.1", "192.168.101.1" ]
    $dnssearchpath = [ "bar", "bar.local" ]
    include basenode
}

In my case, basenode includes a network module that contains a
resolv.conf file resource.  The resolv.conf resource references the
variables instead of hard coding the actual values.  So, your
definition would look like this:

resolv_conf { "example":
    domainname   => $dnsname,
    searchpath     => $dnssearchpath,
    nameservers  => $dnsserver,
}

I'm not using the same resolv.conf recipe that you are, but I think I
want to tweak my template a little now :)

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

Reply via email to