Exclude empty groups
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
parent
d1ee16d332
commit
8b23d10aff
1 changed files with 2 additions and 0 deletions
|
@ -4,12 +4,14 @@
|
||||||
## {{ env }}
|
## {{ env }}
|
||||||
|
|
||||||
{% for key, value in groups.iteritems() %}
|
{% for key, value in groups.iteritems() %}
|
||||||
|
{% if groups[key] != [] %}
|
||||||
define hostgroup{
|
define hostgroup{
|
||||||
hostgroup_name {{ key }}
|
hostgroup_name {{ key }}
|
||||||
alias {{ key }}
|
alias {{ key }}
|
||||||
members {% for host in groups[key] %}{{host}}, {% endfor %}
|
members {% for host in groups[key] %}{{host}}, {% endfor %}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue