diff options
author | David Spencer <idlemoor@slackbuilds.org> | 2016-11-17 17:41:26 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2016-11-19 07:31:28 +0700 |
commit | 206336c0bcbffbdd89d55453feb6bf29dcb62243 (patch) | |
tree | 09f9a267edbe6cadb5b8dacdaf53bf220b4e7d42 /system | |
parent | 2d76c763409a2a6bb74a308faca8384ebabdc2e3 (diff) |
system/salt: Updated for version 2016.3.4.
Thanks to bjwebb.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r-- | system/salt/README | 40 | ||||
-rw-r--r-- | system/salt/doinst.sh | 27 | ||||
-rw-r--r-- | system/salt/rc.salt-master.new | 49 | ||||
-rw-r--r-- | system/salt/rc.salt-minion.new | 49 | ||||
-rw-r--r-- | system/salt/rc.salt-syndic.new | 49 | ||||
-rw-r--r-- | system/salt/salt.SlackBuild | 22 | ||||
-rw-r--r-- | system/salt/salt.info | 8 | ||||
-rw-r--r-- | system/salt/slack-desc | 6 |
8 files changed, 235 insertions, 15 deletions
diff --git a/system/salt/README b/system/salt/README index 68aa92a08bed..4a0e3171869a 100644 --- a/system/salt/README +++ b/system/salt/README @@ -1,10 +1,14 @@ -SaltStack or Salt is a Python-based open source configuration management and -remote execution engine. +SaltStack or Salt is a Python-based open source configuration +management and remote execution engine. -At this time, there is no support for minions running Slackware. +This SlackBuild packages both the master and the minion. + +Note: at this time, the pkg and service modules are not available +(unimplemented) in minions running Slackware. Optional dependencies include: python-ldap + GitPython Mako libvirt pyOpenSSL @@ -15,5 +19,33 @@ Optional dependencies include: redis-py python-gnupg -For configuration details, please see: +You must configure your master and your minions correctly before using +salt. For configuration details, please see: + https://docs.saltstack.com/en/latest/ref/configuration/index.html + +To start the salt daemons automatically on your systems, you can add the +following lines to /etc/rc.d/rc.local, and then on each system enable +only the daemons you actually want, by making the rc scripts executable. + + if [ -x /etc/rc.d/rc.salt-master ]; then + /etc/rc.d/rc.salt-master start + fi + if [ -x /etc/rc.d/rc.salt-minion ]; then + /etc/rc.d/rc.salt-minion start + fi + if [ -x /etc/rc.d/rc.salt-syndic ]; then + /etc/rc.d/rc.salt-syndic start + fi + +On a master, you should enable the salt-master daemon, and probably also +the salt-minion daemon: + + chmod +x /etc/rc.d/rc.salt-{master,minion} + +On a minion, you should enable only the salt-minion daemon: + + chmod +x /etc/rc.d/rc.salt-minion + +You probably won't want to enable the salt-syndic daemon unless you have +configured a complex topology. diff --git a/system/salt/doinst.sh b/system/salt/doinst.sh new file mode 100644 index 000000000000..7af961a5ca83 --- /dev/null +++ b/system/salt/doinst.sh @@ -0,0 +1,27 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/rc.d/rc.salt-master.new +preserve_perms etc/rc.d/rc.salt-minion.new +preserve_perms etc/rc.d/rc.salt-syndic.new diff --git a/system/salt/rc.salt-master.new b/system/salt/rc.salt-master.new new file mode 100644 index 000000000000..d4c851f5a5a0 --- /dev/null +++ b/system/salt/rc.salt-master.new @@ -0,0 +1,49 @@ +#!/bin/sh +# Start/stop/restart salt master + +PIDFILE=/var/run/salt-master.pid +LOGFILE=/var/log/salt/master +# LOGLEVEL: One of: all, garbage, trace, debug, info, warning, error, quiet +LOGLEVEL=warning + +# Start salt-master: +salt_master_start() { + if [ -x /usr/bin/salt-master ]; then + echo "Starting salt-master daemon: /usr/bin/salt-master" + /usr/bin/salt-master -d \ + --pid-file=$PIDFILE \ + --log-file=$LOGFILE \ + --log-file-level=$LOGLEVEL + fi +} + +# Stop salt-master: +salt_master_stop() { + if [ -s $PIDFILE ] ; then + kill $(cat $PIDFILE) + else + killall salt-master + fi + rm -f $PIDFILE +} + +# Restart salt-master: +salt_master_restart() { + salt_master_stop + sleep 1 + salt_master_start +} + +case "$1" in +'start') + salt_master_start + ;; +'stop') + salt_master_stop + ;; +'restart') + salt_master_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac diff --git a/system/salt/rc.salt-minion.new b/system/salt/rc.salt-minion.new new file mode 100644 index 000000000000..f699a12f25bd --- /dev/null +++ b/system/salt/rc.salt-minion.new @@ -0,0 +1,49 @@ +#!/bin/sh +# Start/stop/restart salt minion + +PIDFILE=/var/run/salt-minion.pid +LOGFILE=/var/log/salt/minion +# LOGLEVEL: One of: all, garbage, trace, debug, info, warning, error, quiet +LOGLEVEL=warning + +# Start salt-minion: +salt_minion_start() { + if [ -x /usr/bin/salt-minion ]; then + echo "Starting salt-minion daemon: /usr/bin/salt-minion" + /usr/bin/salt-minion -d \ + --pid-file=$PIDFILE \ + --log-file=$LOGFILE \ + --log-file-level=$LOGLEVEL + fi +} + +# Stop salt-minion: +salt_minion_stop() { + if [ -s $PIDFILE ] ; then + kill $(cat $PIDFILE) + else + killall salt-minion + fi + rm -f $PIDFILE +} + +# Restart salt-minion: +salt_minion_restart() { + salt_minion_stop + sleep 1 + salt_minion_start +} + +case "$1" in +'start') + salt_minion_start + ;; +'stop') + salt_minion_stop + ;; +'restart') + salt_minion_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac diff --git a/system/salt/rc.salt-syndic.new b/system/salt/rc.salt-syndic.new new file mode 100644 index 000000000000..c8986e21a215 --- /dev/null +++ b/system/salt/rc.salt-syndic.new @@ -0,0 +1,49 @@ +#!/bin/sh +# Start/stop/restart salt syndic + +PIDFILE=/var/run/salt-syndic.pid +LOGFILE=/var/log/salt/syndic +# LOGLEVEL: One of: all, garbage, trace, debug, info, warning, error, quiet +LOGLEVEL=warning + +# Start salt-syndic: +salt_syndic_start() { + if [ -x /usr/bin/salt-syndic ]; then + echo "Starting salt-syndic daemon: /usr/bin/salt-syndic" + /usr/bin/salt-syndic -d \ + --pid-file=$PIDFILE \ + --log-file=$LOGFILE \ + --log-file-level=$LOGLEVEL + fi +} + +# Stop salt-syndic: +salt_syndic_stop() { + if [ -s $PIDFILE ] ; then + kill $(cat $PIDFILE) + else + killall salt-syndic + fi + rm -f $PIDFILE +} + +# Restart salt-syndic: +salt_syndic_restart() { + salt_syndic_stop + sleep 1 + salt_syndic_start +} + +case "$1" in +'start') + salt_syndic_start + ;; +'stop') + salt_syndic_stop + ;; +'restart') + salt_syndic_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac diff --git a/system/salt/salt.SlackBuild b/system/salt/salt.SlackBuild index b64fd66a36da..375a7645ec2e 100644 --- a/system/salt/salt.SlackBuild +++ b/system/salt/salt.SlackBuild @@ -23,13 +23,13 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=salt -VERSION=${VERSION:-2016.3.2} +VERSION=${VERSION:-2016.3.4} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) ARCH=i486 ;; + i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac @@ -40,8 +40,8 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" @@ -74,8 +74,15 @@ python setup.py install --root=$PKG find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true +mkdir -p $PKG/etc/$PRGNAM +cp -a conf/* $PKG/etc/$PRGNAM + +mkdir -p $PKG/etc/rc.d +cp -a $CWD/rc.* $PKG/etc/rc.d + mv $PKG/usr/share/man $PKG/usr/man rmdir --ignore-fail-on-non-empty $PKG/usr/share +cp -a doc/man/salt.1 $PKG/usr/man/man1/ find $PKG/usr/man -type f -exec gzip -9 {} \; for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done @@ -86,6 +93,13 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG + +for i in $( find etc/$PRGNAM -type f ) ; do + mv $i $i.new + echo "config $i.new" >> $PKG/install/doinst.sh +done + /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/salt/salt.info b/system/salt/salt.info index d3604cb97fed..2c56ea40145a 100644 --- a/system/salt/salt.info +++ b/system/salt/salt.info @@ -1,10 +1,10 @@ PRGNAM="salt" -VERSION="2016.3.2" +VERSION="2016.3.4" HOMEPAGE="https://saltstack.com/community/" -DOWNLOAD="https://github.com/saltstack/salt/releases/download/v2016.3.2/salt-2016.3.2.tar.gz" -MD5SUM="27a9bb34c205ffe07e95b316e2131177" +DOWNLOAD="https://pypi.python.org/packages/d1/9e/95ad58e5fa399079761d96116f375c88a83a50684b29f5326fb941aa44b5/salt-2016.3.4.tar.gz" +MD5SUM="9a110f379d8af6be9b0a692430cc17a6" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="msgpack-python PyYAML Jinja2 MarkupSafe python-requests tornado futures zeromq pyzmq pycrypto" +REQUIRES="msgpack-python PyYAML Jinja2 MarkupSafe python-requests singledispatch tornado futures zeromq pyzmq pycrypto python-certifi" MAINTAINER="David Spencer" EMAIL="baildon.research@googlemail.com" diff --git a/system/salt/slack-desc b/system/salt/slack-desc index 8841b7023e25..0698d964a946 100644 --- a/system/salt/slack-desc +++ b/system/salt/slack-desc @@ -11,9 +11,9 @@ salt: salt: SaltStack or Salt is a Python-based open source configuration salt: management and remote execution engine. salt: -salt: Note: At this time there is no support for minions running Slackware. -salt: -salt: https://saltstack.com/community/ +salt: Note: at this time, the pkg and service modules are not available +salt: (unimplemented) in minions running Slackware. salt: +salt: Homepage: https://saltstack.com/community/ salt: salt: |