[Puppet Users] Re: variables in variable and class names

John Lyman
Fri, 07 May 2010 15:57:12 -0000

Does class hostconfig::mynewserver::settings contain just variables?

You could do something like this (from
http://groups.google.com/group/puppet-users/browse_thread/thread/5ba9d8b1ed4d4d1a/1214d616ef5caec0)...
==In my nodes.pp, I define certain "default" 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
}

--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at