mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
use state file to only send highstate initiated event once
This commit is contained in:
@@ -20,8 +20,18 @@ vm_highstate_trigger:
|
||||
status: Highstate Initiated
|
||||
vm_name: {{ grains.id }}
|
||||
hypervisor: {{ salt['grains.get']('salt-cloud:profile', '').split('-')[1] }}
|
||||
- unless: test -f /opt/so/state/highstate_trigger.txt
|
||||
- order: 1 # Ensure this runs early in the highstate process
|
||||
|
||||
# Check if the trigger has already run
|
||||
vm_highstate_trigger_file:
|
||||
file.managed:
|
||||
- name: /opt/so/state/highstate_trigger.txt
|
||||
- contents: |
|
||||
VM Highstate Trigger executed at: {{ salt['cmd.run']('date') }}
|
||||
- onchanges:
|
||||
- event: vm_highstate_trigger
|
||||
|
||||
{% else %}
|
||||
|
||||
{{sls}}_no_license_detected:
|
||||
|
||||
Reference in New Issue
Block a user