I have quation: how i may use nested variables/facts? For example, I
have variable $iface. It's variable declared in node brakets, and, use
with defenition. iface may be eth0, eth1(Linux), em0, ...
<freebsd>, ...
is fact:
facter | grep eth0 | grep mac
macaddress_eth0 => 54:52:00:3D:CB:40
We don'nt know name of $iface in our module (to generate network
settings), how we may use nested variables/facts? Syntax:
$mac = ${$macaddress_${iface}}
Does'nt work.
In documentation i did'nt find answer for my quation...
> --
>
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en
> .
>
>
Do you may print simple working example?
I don't find it in documentation, sorry
On 24 дек, 11:09, Mike Pountney <mike.pount...@gmail.com> wrote:
> Have a look at the generate() and inline_template() functions, one of
> which should provide you with a workaround to your problem. There may
> be a more elegant solution though.
>
$ifaces = split($interfaces, ',')
define do::it {
$tpl = "<% if has_variable?(\"ipaddress_$name\") -%>
The IP address for $name is: <%= ipaddress_$name %>
<% end -%>
"
notice(inline_template($tpl))
}
do::it { $ifaces: }
-scott
Happy New Year!
Silviu
> Does'nt work.
>
> In documentation i did'nt find answer for my quation...
>
Have you tried that? Doesn't work for me in 0.25.1.
-scott
Silviu
> -scott