pass in UPDATE_DIR as a pillar

This commit is contained in:
m0duspwnens
2024-02-14 13:28:12 -05:00
parent 2e9fa2438b
commit 79e98e508f
2 changed files with 3 additions and 6 deletions

View File

@@ -6,11 +6,8 @@ remove_common_so-firewall:
file.absent:
- name: /opt/so/saltstack/default/salt/common/tools/sbin/so-firewall
{% if salt['pillar.get']('global:airgap') %}
{% set UPDATE_DIR='/tmp/soagupdate/SecurityOnion'%}
{% else %}
{% set UPDATE_DIR='/tmp/sogh/securityonion'%}
{% endif %}
{# this pillar isn't defined anywhere. it is passed in from soup when the state is called #}
{% set UPDATE_DIR= salt['pillar.get']('UPDATE_DIR') %}
copy_so-common_common_tools_sbin:
file.copy:

View File

@@ -803,7 +803,7 @@ verify_latest_update_script() {
echo "Succesfully updated soup scripts."
else
echo "There was a problem updating soup scripts. Trying to rerun script update."
salt-call state.apply common.soup_scripts queue=True -linfo --file-root=$UPDATE_DIR/salt --local
salt-call state.apply common.soup_scripts queue=True -linfo --file-root=$UPDATE_DIR/salt --local pillar="{'UPDATE_DIR': $UPDATE_DIR}"
fi
echo ""