step 02
This commit is contained in:
parent
bbe354f7fe
commit
e4250e901a
1 changed files with 17 additions and 5 deletions
|
@ -3,16 +3,28 @@
|
|||
###############
|
||||
## {{ env }}
|
||||
|
||||
{% for key, value in groups.iteritems() %}
|
||||
{% if groups[key] %}
|
||||
{% if env == "staging" %}
|
||||
|
||||
define hostgroup{
|
||||
hostgroup_name {{ key }}
|
||||
alias {{ key }}
|
||||
members {% for host in groups[key] %}{% if (hostvars[host].env is defined) and (hostvars[host].env == 'staging') %} {{host}}, {% endif %} {% endfor %}
|
||||
hostgroup_name all
|
||||
alias all
|
||||
members {% for host in groups['all'] %}{% if (hostvars[host].env is defined) and (hostvars[host].env == 'staging') %} {{host}}, {% endif %} {% endfor %}
|
||||
|
||||
}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
|
||||
{% for key, value in groups.iteritems() %}
|
||||
{% if groups[key] %}
|
||||
define hostgroup{
|
||||
hostgroup_name {{ key }}
|
||||
alias {{ key }}
|
||||
members {% for host in groups[key] %}{{host}}, {% endfor %}
|
||||
|
||||
}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue