mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-20 16:03:06 +01:00
use cron instead of schedule for vm init. ensure vm shutdown
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
init_node_schedule:
|
||||
schedule.present:
|
||||
- name: init_node
|
||||
- function: state.sls
|
||||
- job_args:
|
||||
- setup.virt.init
|
||||
- minutes: 1
|
||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||
# Elastic License 2.0.
|
||||
|
||||
# initially tried to use schedule.present here, but that state trys to return data to the master even if run with --local
|
||||
# that causes it to fail since th firewall may not yet be open on the manager
|
||||
init_node_cron:
|
||||
cron.present:
|
||||
- name: salt-call state.apply setup.virt.init
|
||||
- identifier: init_node_cron
|
||||
- user: root
|
||||
- minute: '*/1'
|
||||
|
||||
@@ -8,10 +8,12 @@ set_role_grain:
|
||||
- name: role
|
||||
- value: so-{{ grains.id.split("_") | last }}
|
||||
|
||||
# disable the initial schedule
|
||||
remove_init_node_schedule:
|
||||
schedule.absent:
|
||||
- name: init_node
|
||||
# remove the initial cron
|
||||
remove_init_node_cron:
|
||||
cron.absent:
|
||||
- name: salt-call state.apply setup.virt.init
|
||||
- identifier: init_node_cron
|
||||
- user: root
|
||||
|
||||
set_highstate:
|
||||
file.append:
|
||||
|
||||
Reference in New Issue
Block a user