Skip to content
Snippets Groups Projects
Verified Commit f2d13370 authored by Marek Jaroš's avatar Marek Jaroš :metal:
Browse files

Conditional check for services and notifications

parent 455c8125
No related branches found
No related tags found
No related merge requests found
......@@ -118,9 +118,11 @@
attrs: "{{ item.1.attrs |combine(notify_attrs) }}"
state: "{{ item.1.state |default('present') }}"
loop: "{{ q('subelements', icinga_notify_items, 'notifications', {'skip_missing': True}) }}"
when:
- icinga_notify_items | length > 0
- include_tasks: "{{ playbook_dir }}/icinga/icinga-base.yml"
when:
- item.notifications is defined
- icinga_notify_items | length > 0
...
......@@ -61,9 +61,11 @@
attrs: "{{ item.1.attrs }}"
state: "{{ item.1.state |default('present') }}"
loop: "{{ q('subelements', icinga_service_items, 'services', {'skip_missing': True}) }}"
when:
- icinga_service_items | length > 0
- include_tasks: "{{ playbook_dir }}/icinga/icinga-base.yml"
when:
- ( item.services is defined ) or ( item.services_combined is defined )
- icinga_service_items | length > 0
...
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment