Hi,
I have just found something very weird. I define this:
define networking::basic_interface ($ip, $netmask = hiera('netmask'),
$gateway = hiera('gateway')) {
file { "/etc/sysconfig/network-scripts/ifcfg-${name}" :
content =>
"DEVICE=${name}\nIPADDR=${ip}\nNETMASK=${netmask}\nGATEWAY=${gateway}\nONBOOT=yes\n",
mode => '0644', owner => 'root', group => 'root',
}
}
And create the resource doing:
networking::basic_interface { "eth0:0": ip => '1.2.3.4' }
So, the variables $netmask and $gateway should pick up their default
values, that are taken from Hiera. But then, when I apply the manifests
in the node, the value picked up is the one from Facter.
To summarize: the content of the file takes ${netmask} which is a
parameter of the define, but it turns out that the fact $::netmask has
preference over it. How is it possible?
Thanks!
Pablo
--
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+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.