On Jun 24, 2011, at 7:15 AM, Jonathan Gazeley wrote:
> For my puppet-managed servers, I want roughly half to use nameserver1
> followed by nameserver2, and the other half to use nameserver2 in preference
> to nameserver1.
>
> The most reliable and simplest way I can think of doing this is to look at
> the last octet of the IP address, test whether it is even or odd, and apply
> different nameservers accordingly.
>
> Two questions: how would this be easily achieved in a manifest, and is there
> a better way? :)
----
I would probably create a custom fact for this
IP_ADDR="192.168.10.21"
y=#{IP_ADDR}.split('.')[3].to_i).divmod(2)[1]
puts y
something like...
$resolv.conf_pool = "resolv.conf-pool-A"
#{IP_ADDR}.split('.')[3].to_i).divmod(2)[1] == 0 ? "resolv.conf-pool-A" :
"resolv.conf-pool-B"
and then 'source' the actual resolv.conf file per pool-A or pool-B result
Should be relatively easy to create.
--
Craig White ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [email protected]
1.800.869.6908 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ www.ttiassessments.com
Need help communicating between generations at work to achieve your desired
success? Let us help!
--
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.