This commit is contained in:
m0duspwnens
2020-03-26 15:45:19 -04:00
parent 22127a3d58
commit c14f32fcc9
4 changed files with 40 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
{% set CHECKS = salt['pillar.get']('healthcheck:checks', {} %}
{% set ENABLED = salt['pillar.get']('healthcheck:enabled', False %}
{% set SCHEDULE = salt['pillar.get']('healthcheck:schedule', 30 %}
{% set CHECKS = salt['pillar.get']('healthcheck:checks', {}) %}
{% set ENABLED = salt['pillar.get']('healthcheck:enabled', False) %}
{% set SCHEDULE = salt['pillar.get']('healthcheck:schedule', 30) %}
{% if CHECKS and ENABLED %}
{% set STATUS = ['present','enabled'] %}
@@ -10,17 +10,16 @@ nohealthchecks:
test.configurable_test_state:
- name: nohealthchecks
- changes: True
- result: False
- comment: No checks are enabled for the healthcheck schedule
- warnings: Add checks to the healcheck:checks pillar
- result: True
- comment: 'No checks are enabled for the healthcheck schedule'
{% endif %}
healthcheck_schedule_{{STATUS[0]}}:
schedule.{{STATUS[0]}}:
healthcheck_schedule_{{ STATUS[0] }}:
schedule.{{ STATUS[0] }}:
- name: healthcheck
- function: healthcheck.run
- minutes: {{ SCHEDULE }}
healthcheck_schedule_{{STATUS[1]}}:
schedule.{{STATUS[1]}}:
healthcheck_schedule_{{ STATUS[1] }}:
schedule.{{ STATUS[1] }}:
- name: healthcheck