Hi,
  I'm looking to combine a couple of fact names with the value of a class 
parameter to create and lookup the resulting fact's value.  Is that 
possible?  For example, my class will take the parameter "my_default_nic" 
from beyond.  So I know that as long as $my_default_nic exists on the 
client, then so will facts like macaddress_<NIC>, netmask_<NIC>, and 
ipaddress_<NIC>.  So I'm looking for a way to formulate those fact names 
and evaluate the result...

Is this at all possible?  Thanks for your thoughts!

$my_default_nic = 'eth1'
> $ip_method = 'static'
> $my_ip = ???????????                        ###  <-  should end up looking 
> like the value of $::ipaddress_eth1 with out hardcoding eth1
> $my_netmask = ?????????                     ###  <- <same idea as $my_ip>
>
> case $ip_method {
>   'static': {
>     network::static { $my_default_nic:
>       ensure      => up,
>       ipaddress => $my_ip,
>       netmask  => $my_netmask,
>      }
>   }
>   /(?i:dhcp|dynamic)': {
>     network::dynamic { $my_default_nic: 
>       ensure => up,
>     }
>   }
>   default: {
>     network::dynamic { $my_default_nic:
>       ensure => down,
>    }
> }
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/fc39aa90-27f9-44dc-b478-3a288f1111f2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to