Hello folks

i need a bit of help calculating the network address from ip an netmask 
avoiding the use of stdlib within a puppet maifest. 

#given IP address and netmask
$ip="10.122.3.177"
$nm="255.255.255.128"

#splitting into octets -  split() didnt work for some reason
if $ip =~ /([0-9]+)\.[0-9]+\.[0-9]+\.[0-9]+/ {$ip1 = $1} #  same for $ip2 = 
$2  .......
if $nm =~ /([0-9]+)\.[0-9]+\.[0-9]+\.[0-9]+/ {$nm1 = $1}

# apply boolean AND 
$oc1=$ip1 && $nm1
##### Could not parse for environment production: Could not match && at 
.......


notify {"$oc1":}

thanks for your help

-- 
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/589710e2-c5ad-4fe7-845a-beeaae84257c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to