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,7 +20,17 @@ vm_highstate_trigger:
|
|||||||
status: Highstate Initiated
|
status: Highstate Initiated
|
||||||
vm_name: {{ grains.id }}
|
vm_name: {{ grains.id }}
|
||||||
hypervisor: {{ salt['grains.get']('salt-cloud:profile', '').split('-')[1] }}
|
hypervisor: {{ salt['grains.get']('salt-cloud:profile', '').split('-')[1] }}
|
||||||
- order: 1 # Ensure this runs early in the highstate process
|
- 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 %}
|
{% else %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user