mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-02-09 08:13:50 +08:00
Try to filter the group contents instead of the group names
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
@@ -731,6 +731,8 @@ proxy110.rdu3.fedoraproject.org
|
||||
[proxies_ocp4]
|
||||
proxy01.iad2.fedoraproject.org
|
||||
proxy10.iad2.fedoraproject.org
|
||||
proxy01.rdu3.fedoraproject.org
|
||||
proxy10.rdu3.fedoraproject.org
|
||||
|
||||
[proxies_iad2]
|
||||
proxy01.iad2.fedoraproject.org
|
||||
@@ -1348,10 +1350,12 @@ oci-candidate-registry01.stg.rdu3.fedoraproject.org
|
||||
## Not the candidate just the top registry
|
||||
[moby_registry]
|
||||
oci-registry01.iad2.fedoraproject.org
|
||||
oci-registry01.rdu3.fedoraproject.org
|
||||
|
||||
## Not the candidate just the top registry
|
||||
[moby_registry_stg]
|
||||
oci-registry01.stg.iad2.fedoraproject.org
|
||||
oci-registry01.stg.iad2.fedoraproject.org
|
||||
|
||||
[webservers:children]
|
||||
proxies
|
||||
|
||||
@@ -15,14 +15,14 @@ define hostgroup {
|
||||
define hostgroup {
|
||||
hostgroup_name proxies
|
||||
alias Web Servers
|
||||
members {% for host in groups["proxies_external"]|sort %} {{ hostvars[host]["inventory_hostname_short"] }}.fedoraproject.org {% if not loop.last %}, {% endif %} {% endfor %}
|
||||
members {% for host in groups["proxies_external"]|sort if hostvars[host].datacenter == datacenter %} {{ hostvars[host]["inventory_hostname_short"] }}.fedoraproject.org {% if not loop.last %}, {% endif %} {% endfor %}
|
||||
|
||||
}
|
||||
|
||||
define hostgroup {
|
||||
hostgroup_name proxies_ocp4
|
||||
alias OCP Web Servers
|
||||
members {% for host in groups["proxies_ocp4"]|sort %} {{ hostvars[host]["inventory_hostname_short"] }}.fedoraproject.org {% if not loop.last %}, {% endif %} {% endfor %}
|
||||
members {% for host in groups["proxies_ocp4"]|sort if hostvars[host].datacenter == datacenter %} {{ hostvars[host]["inventory_hostname_short"] }}.fedoraproject.org {% if not loop.last %}, {% endif %} {% endfor %}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
###############
|
||||
## {{ env }}
|
||||
{% for key, value in groups.items()|sort %}
|
||||
{% if groups[key] != [] and key not in vars['exclude_iad2_hostgroups'] and '_' ~ datacenter in key %}
|
||||
{% if groups[key] != [] and key not in vars['exclude_iad2_hostgroups'] %}
|
||||
define hostgroup{
|
||||
hostgroup_name {{ key }}
|
||||
alias {{ key }}
|
||||
{%- for host in groups[key]|sort if hostvars[host].nagios_Can_Connect == true %}
|
||||
{%- for host in groups[key]|sort if hostvars[host].datacenter == datacenter and hostvars[host].nagios_Can_Connect == true %}
|
||||
{% if loop.first +%}
|
||||
members {{ host }}{% else %}, {{ host }}{% endif %}
|
||||
{% endfor +%}
|
||||
|
||||
Reference in New Issue
Block a user