I guess my answer was: you can use ruby's library ipaddr inside
templates, not sure about manifests.

On Thu, Jan 27, 2011 at 2:36 PM, Nick Moffitt <[email protected]> wrote:
> I have a few settings that change based on the network that a system is
> in, and I have a heterogeneous collection of networks (a few /24s, some
> /25s, a /29 and a couple /27s, and hey look a /16 in rfc1918 space
> and...).  So I can't do simple regex matches on dotted-quad IP notation
> and expect to get a complete story.
>
> What I'd like is something like, I dunno...
>
>        $nameserver = $::ipaddress ? {
>                cidr('172.242.0.0/16')  => '172.242.111.222',
>                cidr('192.168.55.0/25') => '192.168.55.5',
>                cidr('192.168.55.128/25')       => '192.168.55.205',
>                ...
>        }
>
> Or really any way to determine whether or not a particular IP string
> satisfies a given CIDR range.
>
> How do you people solve this sort of problem?
>
> --
> "There should be a homonym exam before people are
> issued keyboards."     -- George Moffitt
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to