You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Hi folks,
Short version:
I want to use a variable inside a variable to access a fact. Is this
possible?
Long version:
Facter provides facts $::ipaddress and $::netmask which figure out which
is your primary interface and then return values like $::ipaddress_eth0
and $::netmask_eth0. However there is not a $::network fact to reflect
$::network_eth0.
I have a custom fact $::gateway_dev which returns the name of the
primary interface. Is it possible to access the variable like
${::network_${::gateway_dev}} ?
Thanks,
Jonathan
--
Jonathan Gazeley
Senior Systems Administrator
IT Services
University of Bristol
Daniel Sung
unread,
Mar 31, 2016, 6:21:23 AM3/31/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Puppet Users
I achieve this by using the getvar function in stdlib. For example:
getvar("::network_${::gateway_dev}")
Regards, Daniel
Jonathan Gazeley
unread,
Mar 31, 2016, 6:44:47 AM3/31/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message