Sha256: ec5d15117543f8d207c94a6d5a05d0db8072b805caaaa538d379169e409f7b44

Contents?: true

Size: 1.54 KB

Versions: 2

Compression:

Stored size: 1.54 KB

Contents

#!/bin/bash

no_check=false
case "$1" in
--no-check)
        no_check=true
        shift
        ;;
esac
runit()
{
	case "$#" in
	0)
		echo "Running all states ..."
		sudo salt-call saltutil.sync_all
		sudo salt-call state.highstate 
		;;
	*)
		for file; do
			echo "Running $file ..."
			sudo salt-call state.sls "$file"
		done
		;;
	esac
}
case "$1" in
run)
	shift
        if $no_check; then
                # Color is used when there is no checking (piped output)
                runit "$@"
                exit
        fi
        runit "$@" 2>&1 | tee /tmp/t$$
        echo
        echo Checking results log:
        ret=
        if egrep '^\[ERROR *\]' /tmp/t$$; then
                echo ERROR: `egrep '^\[ERROR *\]' /tmp/t$$ | wc -l` ERRORS FOUND IN LOG
                ret=1
        fi
        if egrep '^ *Result: *False' /tmp/t$$ > /dev/null; then
                echo 'WARNING (' `egrep '^ *Result: *False' /tmp/t$$ | wc -l` 'Results where False in log)'
                ret=${ret:-2}
        fi
        if [ -z "$ret" ] ; then
                echo SUCCESS
        fi
        rm -f /tmp/t$$
        exit $ret

	;;
grains)
	sudo salt-call grains.items
	;;
pillar)
	sudo salt-call pillar.items
	;;
packages)
	dpkg --get-selections | sed -n 's/\s\s*install//p'
	;;
search)
        aptitude search "$@"
        #apt-cache search "$@"
        ;;
install|remove|purge|update|upgrade|clean|autoremove)
	sudo apt-get "$@"
	;;
*)
	echo "usage: $0 grains|pillar|run [state]|packages|search|install package|remove package|purge package|autoclean|autoremove\n"
	;;
esac
		

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
salted-rails-0.0.8 salt/bin/provision
salted-rails-0.0.7 salt/bin/provision