Check to ensure vars.tags is defined in Nagios template
This commit is contained in:
parent
d3ccfe8336
commit
e1138ebaad
@ -139,6 +139,7 @@ define hostgroup {
|
|||||||
# Inventory Hosts and related services
|
# Inventory Hosts and related services
|
||||||
{% for host in groups['tags_nagios'] %}
|
{% for host in groups['tags_nagios'] %}
|
||||||
{% set vars = hostvars[host] %}
|
{% set vars = hostvars[host] %}
|
||||||
|
{% if vars.tags is defined %}
|
||||||
define host {
|
define host {
|
||||||
use ansible-linux-server
|
use ansible-linux-server
|
||||||
host_name {{ host }}
|
host_name {{ host }}
|
||||||
@ -213,4 +214,5 @@ define service {
|
|||||||
{# #}
|
{# #}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user