-{% if inventory_hostname in groups.glusterfs or inventory_hostname in groups.glusterfs_registry %}
+{% if (groups.glusterfs is defined and inventory_hostname in groups.glusterfs) or (groups.glusterfs_registry is defined and inventory_hostname in groups.glusterfs_registry) %}