Hi,

I need help with the bellow configuration in Jinja, I'm using a for loop to 
populate the hosts from a group defined in my inventory and that's working 
good but what my application requires is a letter in front of every host in 
alphabetical order depending how many host numbers I have :


# servers.ini :
[server-slaves]
server1.example.com
server2.example.com
server3.example.com

# config.conf.j2 :
slaves_hosts={% for host in groups['server-slaves'] %}
{{ host }}{% if not loop.last %},{% endif %}
{% endfor %}

# output :
slaves_hosts=server1.example.com,server2.example.com,server3.example.com

# desired output 
slaves_hosts=*a*:server1.example.com,*b*:server2.example.com,*c*
:server3.example.com

This is possible in Chef, any idea if I can do the same in Ansible and how 
? 

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/25aef324-4ccc-49f1-aac5-d7b96a3db87f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to