mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Merge pull request #4567 from Security-Onion-Solutions/issue/1333
Issue/1333
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
{% if salt['pillar.get']('patch:os:schedule_name') %}
|
||||
{% set patch_os_pillar = salt['pillar.get']('patch:os') %}
|
||||
{% set schedule_name = patch_os_pillar.schedule_name %}
|
||||
{% set splay = patch_os_pillar.get('splay', 300) %}
|
||||
{% if salt['service.status']('salt-minion', True) %}
|
||||
{% set patch_os_pillar = salt['pillar.get']('patch:os') %}
|
||||
{% set schedule_name = patch_os_pillar.schedule_name %}
|
||||
{% set splay = patch_os_pillar.get('splay', 300) %}
|
||||
|
||||
{% if schedule_name != 'manual' and schedule_name != 'auto' %}
|
||||
{% import_yaml "patch/os/schedules/"~schedule_name~".yml" as os_schedule %}
|
||||
{% if schedule_name != 'manual' and schedule_name != 'auto' %}
|
||||
{% import_yaml "patch/os/schedules/"~schedule_name~".yml" as os_schedule %}
|
||||
|
||||
{% if patch_os_pillar.enabled %}
|
||||
{% if patch_os_pillar.enabled %}
|
||||
|
||||
patch_os_schedule:
|
||||
schedule.present:
|
||||
@@ -14,28 +15,28 @@ patch_os_schedule:
|
||||
- job_args:
|
||||
- patch.os
|
||||
- when:
|
||||
{% for days in os_schedule.patch.os.schedule %}
|
||||
{% for day, times in days.items() %}
|
||||
{% for time in times %}
|
||||
{% for days in os_schedule.patch.os.schedule %}
|
||||
{% for day, times in days.items() %}
|
||||
{% for time in times %}
|
||||
- {{day}} {{time}}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
- splay: {{splay}}
|
||||
- return_job: True
|
||||
|
||||
{% else %}
|
||||
{% else %}
|
||||
|
||||
disable_patch_os_schedule:
|
||||
schedule.disabled:
|
||||
- name: patch_os_schedule
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% elif schedule_name == 'auto' %}
|
||||
{% elif schedule_name == 'auto' %}
|
||||
|
||||
{% if patch_os_pillar.enabled %}
|
||||
{% if patch_os_pillar.enabled %}
|
||||
|
||||
patch_os_schedule:
|
||||
schedule.present:
|
||||
@@ -46,22 +47,23 @@ patch_os_schedule:
|
||||
- splay: {{splay}}
|
||||
- return_job: True
|
||||
|
||||
{% else %}
|
||||
{% else %}
|
||||
|
||||
disable_patch_os_schedule:
|
||||
schedule.disabled:
|
||||
- name: patch_os_schedule
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% elif schedule_name == 'manual' %}
|
||||
{% elif schedule_name == 'manual' %}
|
||||
|
||||
remove_patch_os_schedule:
|
||||
schedule.absent:
|
||||
- name: patch_os_schedule
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% else %}
|
||||
|
||||
no_patch_os_schedule_name_set:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
include:
|
||||
- salt.minion-state-apply-test
|
||||
|
||||
{% if salt['service.status']('salt-minion', True) %}
|
||||
state-apply-test:
|
||||
schedule.present:
|
||||
- name: salt-minion-state-apply-test
|
||||
@@ -17,3 +18,4 @@ state-apply-test:
|
||||
- identifier: so-salt-minion-check
|
||||
- user: root
|
||||
- minute: '*/5'
|
||||
{% endif %}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{% if salt['service.status']('salt-minion', True) %}
|
||||
schedule:
|
||||
schedule.present:
|
||||
- function: state.highstate
|
||||
- minutes: 15
|
||||
- maxrunning: 1
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user