Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I did this:

    $worker_name = {
            "app-fr" => { host => [ "app01/10.2.0.1/8009", "app02/10.2.0.2/8009" ] },
            "app-uk" => { host => [ "app09/10.2.0.5/8009", "app10/10.2.0.6/8009" ] }
    }

And I would like to have "app01/10.2.0.1/8009" AND "app02/10.2.0.2/8009".

The goal is to built a workers.properties file for mod_jk.

I have try this:

    <% keys = worker_name.keys %>
    <% for key in 0...keys.length %>
            Key :<%= keys[key] %>
            Host : <%= worker_name[keys[key]]['host'][key] %>
            <%= key %>
    <% end %>

    -----------------------------
    <% worker_name.each do |key,value| -%>

    Key: <%= key %>
    Path: <%= value['host'][0] %>

    <% end -%>

But the second part (after the "-----") I only have "app01/10.2.0.1/8009" and it didn't loop to have "app02/10.2.0.2/8009". And the first part, recovery the same. The second part is more easy to write but that's all.

Then, I'll use the split function to separate "app01" "ip address" "port" with :

 <%= source.split("/")[0] %> <%= source.split("/")[1] %> 

Thanks in advance.

I'm open to every advice :)

share|improve this question
    
No idea? Thanks. –  Richi Oct 26 '11 at 13:30
    
Well, it's quite unclear which result you're expecting. I might be able to help you if you lay it down. –  Pierre Carrier Jul 4 '12 at 4:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.