Fix for non-existing Ansible group

This commit is contained in:
phil 2024-12-03 19:00:17 +01:00
parent 2aa8fc8981
commit 1e6f6056b7
2 changed files with 7 additions and 6 deletions

View file

@ -1,5 +1,5 @@
{% set host_short = inventory_hostname.split('.')[0] %}
{% if inventory_hostname not in groups.storage_boxes %}
{% if inventory_hostname not in groups.storage_boxes | default([] )%}
{%- if ansible_virtualization_role is defined %}{{'{{:cmdb:kvm.png?0x50|}}'}}{% endif %}
{%- if 'nginx' in ansible_facts.packages %}{{'{{:cmdb:nginx.png?0x50|}}'}}{% endif %}
@ -21,7 +21,7 @@
{% include 'section_customer.txt.j2' %}
{% endif %}
{% if inventory_hostname not in groups.storage_boxes %}
{% if inventory_hostname not in groups.storage_boxes | default([]) %}
{% include 'section_general.txt.j2' %}
{% include 'section_os-software.txt.j2' %}
@ -62,6 +62,6 @@
{% endif %}
{% elif inventory_hostname in groups.storage_boxes %}
{% elif inventory_hostname in groups.storage_boxes | default([]) %}
{% include 'section_storage_boxes.txt.j2' %}
{% endif %}