Last active
January 3, 2016 07:39
-
-
Save rjsalts/8430770 to your computer and use it in GitHub Desktop.
Equally divide servers to backends in ansible template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for host in groups['systems-server'] %} | |
{% if host == ansible_fqdn %} | |
{% set target_sysdb = loop.index0 % groups['sysdb-server']|length()|int() %} | |
{{ groups['sysdb-server'][target_sysdb] }} | |
{% endif %} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment