Replace salt code on a saltstack update

This commit is contained in:
Mike Reeves
2022-04-12 11:20:26 -04:00
parent a7221ba2b4
commit 081d7e3a09
2 changed files with 7 additions and 1 deletions

View File

@@ -31,12 +31,18 @@ copy_new_files() {
# Copy new files over to the salt dir # Copy new files over to the salt dir
cd /tmp/sogh/securityonion cd /tmp/sogh/securityonion
VERSION=$(cat VERSION)
git checkout $BRANCH git checkout $BRANCH
# We need to overwrite if there is a repo file
if [ -d /opt/so/repo ]; then
tar -czf /opt/so/repo/"$VERSION".tar.gz -C "$(pwd)/.." .
fi
rsync -a salt $default_salt_dir/ rsync -a salt $default_salt_dir/
rsync -a pillar $default_salt_dir/ rsync -a pillar $default_salt_dir/
chown -R socore:socore $default_salt_dir/salt chown -R socore:socore $default_salt_dir/salt
chown -R socore:socore $default_salt_dir/pillar chown -R socore:socore $default_salt_dir/pillar
chmod 755 $default_salt_dir/pillar/firewall/addfirewall.sh chmod 755 $default_salt_dir/pillar/firewall/addfirewall.sh
rm -rf /tmp/sogh rm -rf /tmp/sogh
} }

View File

@@ -1510,7 +1510,7 @@ generate_passwords(){
} }
generate_repo_tarball() { generate_repo_tarball() {
mkdir /opt/so/repo mkdir -p /opt/so/repo
tar -czf /opt/so/repo/"$SOVERSION".tar.gz -C "$(pwd)/.." . tar -czf /opt/so/repo/"$SOVERSION".tar.gz -C "$(pwd)/.." .
} }