From 7698243cafbb9688049290a9359adef3428cf456 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Fri, 16 Aug 2024 13:37:44 -0400 Subject: [PATCH] fix reactors --- salt/reactor/createEmptyPillar.sls | 10 ++-------- salt/reactor/setup.sls | 6 ++---- salt/reactor/virtReleaseHardware.sls | 8 ++------ salt/reactor/virtUpdate.sls | 6 ++---- salt/salt/master.sls | 10 +++++----- 5 files changed, 13 insertions(+), 27 deletions(-) diff --git a/salt/reactor/createEmptyPillar.sls b/salt/reactor/createEmptyPillar.sls index 95e41eef6..a182e1338 100644 --- a/salt/reactor/createEmptyPillar.sls +++ b/salt/reactor/createEmptyPillar.sls @@ -1,20 +1,14 @@ +#!py + # 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. -#!py - import logging -import salt.client -local = salt.client.LocalClient() -from subprocess import call -import yaml - import os def run(): - #logging.error("createEmptyPillar reactor: data: %s" % data) vm_name = data['kwargs']['name'] logging.error("createEmptyPillar reactor: vm_name: %s" % vm_name) pillar_root = '/opt/so/saltstack/local/pillar/minions/' diff --git a/salt/reactor/setup.sls b/salt/reactor/setup.sls index b8c5ad16c..609691223 100644 --- a/salt/reactor/setup.sls +++ b/salt/reactor/setup.sls @@ -1,13 +1,11 @@ +#!py + # 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. -#!py - import logging -import salt.client -local = salt.client.LocalClient() from subprocess import call import yaml diff --git a/salt/reactor/virtReleaseHardware.sls b/salt/reactor/virtReleaseHardware.sls index 6211fc611..ccf15a618 100644 --- a/salt/reactor/virtReleaseHardware.sls +++ b/salt/reactor/virtReleaseHardware.sls @@ -1,16 +1,12 @@ +#!py + # 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. -#!py - import logging -import salt.client -local = salt.client.LocalClient() -from subprocess import call import yaml - import os def run(): diff --git a/salt/reactor/virtUpdate.sls b/salt/reactor/virtUpdate.sls index e44bc8070..8ccee26f0 100644 --- a/salt/reactor/virtUpdate.sls +++ b/salt/reactor/virtUpdate.sls @@ -1,17 +1,15 @@ +#!py + # 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. -#!py - import logging import salt.client local = salt.client.LocalClient() -from subprocess import call import yaml - def run(): def claim_compute(hw_type): diff --git a/salt/salt/master.sls b/salt/salt/master.sls index 9558352dd..40e1d6210 100644 --- a/salt/salt/master.sls +++ b/salt/salt/master.sls @@ -57,14 +57,14 @@ salt_master_service: #- salt/cloud/*/creating': #- salt/cloud/*/requesting # - 'salt/cloud/*/deploying': -# - /srv/salt/reactor/createEmptyPillar.sls +# - /opt/so/saltstack/default/salt/reactor/createEmptyPillar.sls # - 'setup/so-minion': -# - /srv/salt/reactor/setup.sls +# - /opt/so/saltstack/default/salt/reactor/setup.sls # - 'salt/cloud/*/created': -# - /srv/salt/reactor/virtUpdate.sls +# - /opt/so/saltstack/default/salt/reactor/virtUpdate.sls # - 'salt/cloud/*/destroyed': -# - /srv/salt/reactor/virtReleaseHardware.sls -# - /srv/salt/reactor/deleteKey.sls +# - /opt/so/saltstack/default/salt/reactor/virtReleaseHardware.sls +# - /opt/so/saltstack/default/salt/reactor/deleteKey.sls {% else %}