1717# CREATED: 10/15/2012 09:49:37 PM WEST
1818# ======================================================================================================================
1919set -o nounset # Treat unset variables as an error
20- __ScriptVersion=" 2014.10.30 "
20+ __ScriptVersion=" 2014.12.11 "
2121__ScriptName=" bootstrap-salt.sh"
2222
2323# ======================================================================================================================
@@ -243,7 +243,7 @@ usage() {
243243 -D Show debug output.
244244 -c Temporary configuration directory
245245 -g Salt repository URL. (default: git://github.com/saltstack/salt.git)
246- -G Insteady of cloning from git://github.com/saltstack/salt.git, clone from https://github.com/saltstack/salt.git (Usually necessary on systems which have the regular git protocol port blocked, where https usualy is not)
246+ -G Instead of cloning from git://github.com/saltstack/salt.git, clone from https://github.com/saltstack/salt.git (Usually necessary on systems which have the regular git protocol port blocked, where https usually is not)
247247 -k Temporary directory holding the minion keys which will pre-seed
248248 the master.
249249 -s Sleep time used when waiting for daemons to start, restart and when checking
@@ -2549,7 +2549,7 @@ __install_epel_repository() {
25492549 elif [ " $DISTRO_MAJOR_VERSION " -eq 6 ]; then
25502550 rpm -Uvh --force " http://download.fedoraproject.org/pub/epel/6/${EPEL_ARCH} /epel-release-6-8.noarch.rpm" || return 1
25512551 elif [ " $DISTRO_MAJOR_VERSION " -eq 7 ]; then
2552- rpm -Uvh --force " http://download.fedoraproject.org/pub/epel/7/${EPEL_ARCH} /e/epel-release-7-2 .noarch.rpm" || return 1
2552+ rpm -Uvh --force " http://download.fedoraproject.org/pub/epel/7/${EPEL_ARCH} /e/epel-release-7-5 .noarch.rpm" || return 1
25532553 else
25542554 echoerror " Failed add EPEL repository support."
25552555 return 1
@@ -2567,7 +2567,7 @@ __install_saltstack_copr_zeromq_repository() {
25672567 __REPOTYPE=" epel"
25682568 fi
25692569 wget -O /etc/yum.repos.d/saltstack-zeromq4.repo \
2570- " https ://copr.fedoraproject.org/coprs/saltstack/zeromq4/repo/${__REPOTYPE} -${DISTRO_MAJOR_VERSION} /saltstack-zeromq4-${__REPOTYPE} -${DISTRO_MAJOR_VERSION} .repo" || return 1
2570+ " http ://copr.fedoraproject.org/coprs/saltstack/zeromq4/repo/${__REPOTYPE} -${DISTRO_MAJOR_VERSION} /saltstack-zeromq4-${__REPOTYPE} -${DISTRO_MAJOR_VERSION} .repo" || return 1
25712571 fi
25722572 return 0
25732573}
@@ -2689,9 +2689,9 @@ install_centos_git_deps() {
26892689 install_centos_stable_deps || return 1
26902690 if [ " $DISTRO_NAME_L " = " oracle_linux" ]; then
26912691 # try both ways --enablerepo=X disables ALL OTHER REPOS!!!!
2692- yum -y install git || yum -y install git --enablerepo=${_EPEL_REPO} || return 1
2692+ yum install -y git systemd-python || yum install -y git systemd-python --enablerepo=${_EPEL_REPO} || return 1
26932693 else
2694- yum -y install git --enablerepo=${_EPEL_REPO} || return 1
2694+ yum install -y git systemd-python --enablerepo=${_EPEL_REPO} || return 1
26952695 fi
26962696
26972697 __git_clone_and_checkout || return 1
@@ -2720,6 +2720,7 @@ install_centos_git() {
27202720}
27212721
27222722install_centos_git_post () {
2723+ SYSTEMD_RELOAD=$BS_FALSE
27232724 for fname in minion master syndic api; do
27242725
27252726 # Skip if not meant to be installed
@@ -2728,8 +2729,15 @@ install_centos_git_post() {
27282729 [ $fname = " api" ] && ([ " $_INSTALL_MASTER " -eq $BS_FALSE ] || [ " $( which salt-${fname} 2> /dev/null) " = " " ]) && continue
27292730 [ $fname = " syndic" ] && [ " $_INSTALL_SYNDIC " -eq $BS_FALSE ] && continue
27302731
2731- # While the RPM's use init.d, so will we.
2732- if [ ! -f /etc/init.d/salt-$fname ] || ([ -f /etc/init.d/salt-$fname ] && [ $_FORCE_OVERWRITE -eq $BS_TRUE ]); then
2732+ if [ ! -f /usr/lib/systemd/system/salt-${fname} .service ] || ([ -f /usr/lib/systemd/system/salt-${fname} .service ] && [ $_FORCE_OVERWRITE -eq $BS_TRUE ]); then
2733+ copyfile " ${__SALT_GIT_CHECKOUT_DIR} /pkg/rpm/salt-${fname} .service" /usr/lib/systemd/system/
2734+
2735+ # Skip salt-api since the service should be opt-in and not necessarily started on boot
2736+ [ $fname = " api" ] && continue
2737+
2738+ /bin/systemctl enable salt-${fname} .service
2739+ SYSTEMD_RELOAD=$BS_TRUE
2740+ elif [ ! -f /usr/lib/systemd/system/salt-${fname} .service ] && [ ! -f /etc/init.d/salt-$fname ] || ([ -f /etc/init.d/salt-$fname ] && [ $_FORCE_OVERWRITE -eq $BS_TRUE ]); then
27332741 copyfile " ${__SALT_GIT_CHECKOUT_DIR} /pkg/rpm/salt-${fname} " /etc/init.d/
27342742 chmod +x /etc/init.d/salt-${fname}
27352743
@@ -2753,6 +2761,10 @@ install_centos_git_post() {
27532761 # /sbin/chkconfig salt-${fname} on
27542762 # fi
27552763 done
2764+
2765+ if [ " $SYSTEMD_RELOAD " -eq $BS_TRUE ]; then
2766+ /bin/systemctl daemon-reload
2767+ fi
27562768}
27572769
27582770install_centos_restart_daemons () {
0 commit comments