We are not using Hiera yet (but it seems that this is what we should do in
the close future ...)
At the moment the regexp expression is the simplest one.
Thank you :-)
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.