Josh,
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' }
}
On Friday, 12 April 2013 10:09:00 UTC+1, Josh wrote:
>
> On Friday, April 12, 2013 9:44:31 AM UTC+1, ForumUser wrote:
>
>> We have nodes in different networks - they use different DNS servers.
>> I'd like to set up its /etc/resolv.conf dependent on network they are in.
>>
>
> Are you using Hiera? We run multiple datacentres that have different
> management networks, syslog servers and such, I provide the server with
> knowledge of the datacentre with a custom fact (which just reads a file in
> my case) and then in the hiera config I have:
>
> :hierarchy:
> - nodes/%{hostname}
> - common/%{datacentre}
>
> Then anything specific to the datacentre goes in that file. You could
> easily do something similar for the network.
>
> Alternatively you might be able to define it all in a case statement
> matching the IP address of the server, although depending on how
> complicated your network architecture the regexs could become complicated:
>
> case $::ipaddress_eth0 {
> /^192.168.1/: { $nameserver = '192.168.1.254' }
> /^192.168.2/: { $nameserver = '192.168.2.254' }
> }
>
> Josh
>
--
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.