Steve Neuharth
2010-Jun-24 13:44 UTC
[Puppet Users] question about variable scope in nodes
my node definitions look like this:
node basenode {
$utility_network = x.x.x.x
[...]
}
node ''mcp.c42'' inherits basenode {
$my_local_network = $utility_network
$my_default_gateway = $utility_default_gateway
$my_netmask = $utility_netmask
$my_eth1_default_gateway = $my_default_gateway
$my_eth1_network_addresses = ["10.x.x.x"]
include general
include network #<-- sets up the network like IP addresses, etc
include puppet::master
}
id like to simplify it like this:
(or something like it)
node ''mcp.c42'' inherits basenode {
$eth = ["10.10.31.250"]
include general
include GET_NETWORK_PARAMS_BASED_ON_ADDRESS #<-- parse the IP
and ''figure out'' the netmask, etc...
include network #<-- uses network params like IP address
include puppet::master #<-- also uses network params like
''local_network''
}
I''d like to be able to define a node by entering only it''s ip
address.
we also use multiple interfaces so I was thinking that I''d need to use
a define to ''define'' eth0 or eth1.
my question is that once I define that interface, the other modules
might need to know information about it like netmask. How do I make
the variables created in a define in my node available to the other
classes?
--
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
http://groups.google.com/group/puppet-users?hl=en.