On Thursday, November 21, 2013 6:32:44 AM UTC-6, cko wrote:
>
> Hi,
>
> I'm currently trying to solve the following problem:
>
> I wrote a module that matches the "$ipaddress" fact for certain IP subnets 
> (like 20.20.2... or 30.30.2..). Depending on the subnet, the variable 
> $proxy-server changes.
>
> The problem is, that some of our physical machines have a random number of 
> interfaces connected to many different subnets. In some cases the 
> $ipadddress fact returns the correct subnet, lets call it "production 
> server lan" and some don't.
>
> Is there any way to make puppet check every available NIC for a specific 
> subnet/ regex? Something like this:
>
> if $ipaddress_eth*** =~ /^20\.20\.\..*$/ {
>    $proxy-server = foo 
> }
>



Puppet DSL does not support this directly, but it sounds like a good 
candidate for a custom function.  You could do a proof-of-concept with an 
inline template, even, but I recommend a bona fide function for your final 
implementation.


John

-- 
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/7f75b91e-915b-4f42-b1b9-7e7b20d4e9da%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to