On Friday, April 12, 2013 3:54:16 PM UTC+1, ForumUser wrote:
>
> what if I have 192.168.* with exception of 192.168.100.* ?
> Is the order in case statement important ?
> E.g.:
>
> case $::ipaddress_eth0 {
> /^192.168.100/: { $nameserver = '192.168.100.254' }
> /^192.168./: { $nameserver = '192.168.1.254' }
> }
>
It will choose the first match in the case statement.
You can also add a default (and I would always have a default anyway, even
if it is just to fail with a sensible message)
case $::ipaddress_eth0 {
/^192.168.100/: { $nameserver = '192.168.100.254' }
/^192.168./: { $nameserver = '192.168.1.254' }
default: { fail("You shouldn't get this far") }
}
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.