On 04/15/2011 03:05 PM, Rob McBroom wrote:
On Apr 15, 2011, at 2:58 PM, Ramin K wrote:
I use the IP address to generate a 32bit integer for the server_id for
my Mysql configs.
server_id =<%= ipaddress.split('.').inject(0) {|total,value| (total
<< 8 ) + value.to_i} %>
Would something like that work in your case?
Well, it has to be 999 or less, and the IPs differ enough between them that I
couldn’t just assume the last one or two octets will make it unique. I’ll
probably just use a combination of environment and the integer present in the
hostname.
Thanks.
You need a lookup table plus code that errors out if you try to add too
many entries.
There is no good way to do this mapping without keeping state somewhere.
--
vagn
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.