Re: [Puppet Users] Re: ERB advice

2011-05-06 Thread vagn scott
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

[Puppet Users] Re: ERB advice

2011-04-18 Thread jcbollinger
On Apr 15, 9:30 am, Rob McBroom wrote: > Details below, but the essential problem is this: I need to take a list of > hostnames and assign an integer for each one and ensure that the integer “is > non-negative and is no more than three decimal digits in length”. I’d prefer > that the each hos

Re: [Puppet Users] Re: ERB advice

2011-04-15 Thread Rob McBroom
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 h

[Puppet Users] Re: ERB advice

2011-04-15 Thread Ramin K
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? Ramin On Apr 15, 7:30 am, Rob McBroom wrote: > Details below, but t