mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-02-20 22:15:28 +01:00
This commit is contained in:
25
salt/salt/beacons.sls
Normal file
25
salt/salt/beacons.sls
Normal file
@@ -0,0 +1,25 @@
|
||||
{% set CHECKS = salt['pillar.get']('healthcheck:checks', {}) %}
|
||||
{% set ENABLED = salt['pillar.get']('healthcheck:enabled', False) %}
|
||||
{% set SCHEDULE = salt['pillar.get']('healthcheck:schedule', 30) %}
|
||||
|
||||
include:
|
||||
- salt
|
||||
|
||||
{% if CHECKS and ENABLED %}
|
||||
salt_beacons:
|
||||
file.managed:
|
||||
- name: /etc/salt/minion.d/beacons.conf
|
||||
- source: salt://salt/files/beacons.conf.jinja
|
||||
- template: jinja
|
||||
- defaults:
|
||||
CHECKS: {{ CHECKS }}
|
||||
SCHEDULE: {{ SCHEDULE }}
|
||||
- watch_in:
|
||||
- service: salt_minion_service
|
||||
{% else %}
|
||||
salt_beacons:
|
||||
file.absent:
|
||||
- name: /etc/salt/minion.d/beacons.conf
|
||||
- watch_in:
|
||||
- service: salt_minion_service
|
||||
{% endif %}
|
||||
8
salt/salt/files/beacons.conf.jinja
Normal file
8
salt/salt/files/beacons.conf.jinja
Normal file
@@ -0,0 +1,8 @@
|
||||
{% if CHECKS -%}
|
||||
beacons:
|
||||
{%- for check in CHECKS %}
|
||||
{{ check }}:
|
||||
- disable_during_state_run: True
|
||||
- interval: {{ SCHEDULE }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
4
salt/salt/init.sls
Normal file
4
salt/salt/init.sls
Normal file
@@ -0,0 +1,4 @@
|
||||
salt_minion_service:
|
||||
service.running:
|
||||
- name: salt-minion
|
||||
- enable: True
|
||||
Reference in New Issue
Block a user