Added pre/post flight scripts (not running)

This commit is contained in:
twangboy 2015-12-22 09:28:47 -07:00
parent 9eeb6da7bd
commit 7f0b87bfb3
3 changed files with 61 additions and 0 deletions

View file

@ -136,6 +136,11 @@ mkdir -p $PKGDIR/resources
cp $PKGRESOURCES/saltstack.png $PKGDIR/resources
cp $PKGRESOURCES/*.rtf $PKGDIR/resources
# I can't get this to work for some reason
mkdir -p $PKGDIR/scripts
cp $PKGRESOURCES/scripts/postflight.sh $PKGDIR/scripts
cp $PKGRESOURCES/scripts/preflight.sh $PKGDIR/scripts
############################################################################
# Copy Config Files from Salt Repo to the Package Directory
############################################################################
@ -172,5 +177,6 @@ pkgbuild --root $PKGDIR \
productbuild --resources=$PKGDIR/resources \
--distribution=distribution.xml \
--package-path=salt-src-$VERSION.pkg \
--scripts $PKGDIR/scripts \
--version=$VERSION salt-$VERSION.pkg

30
pkg/osx/scripts/postflight.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/bash
###############################################################################
#
# Title: Post Script for Salt Installation
# Authors: Shane Lee
# Date: December 2015
#
# Description: This script copies the minion config file and starts the salt
# service
#
# Requirements:
# - None
#
# Usage:
# This script is run as a part of the OSX Salt Installation
#
###############################################################################
###############################################################################
# Check for existing minion config, copy if it doesn't exist
###############################################################################
if [ ! -f /etc/salt/minion ]; then
cp /etc/salt/minion.dist /etc/salt/minion
fi
###############################################################################
# Register Salt as a service
###############################################################################
set -e
launchctl load "/Library/LaunchDaemons/com.saltstack.salt.minion.plist"

25
pkg/osx/scripts/preflight.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/bash
###############################################################################
#
# Title: Pre Install Script for Salt Installation
# Authors: Shane Lee
# Date: December 2015
#
# Description: This script stops the salt minion service before attempting to
# install Salt on Mac OSX
#
# Requirements:
# - None
#
# Usage:
# This script is run as a part of the OSX Salt Installation
#
###############################################################################
###############################################################################
# Stop the service
###############################################################################
set -e
if /bin/launchctl list "com.saltstack.salt.minion" &> /dev/null; then
/bin/launchctl unload "/Library/LaunchDaemons/com.saltstack.salt.minion.plist"
fi