mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
Merge pull request #931 from vutny/salt-api-service
Configure `salt-api` service, but do not attempt to start it on all OS
This commit is contained in:
commit
250fd33fc8
1 changed files with 122 additions and 113 deletions
|
@ -2559,14 +2559,13 @@ install_ubuntu_stable_post() {
|
|||
return 0
|
||||
fi
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
# Skip if not meant to be installed
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ]; then
|
||||
|
@ -2582,13 +2581,14 @@ install_ubuntu_stable_post() {
|
|||
fi
|
||||
done
|
||||
}
|
||||
install_ubuntu_git_post() {
|
||||
for fname in minion master syndic api; do
|
||||
|
||||
install_ubuntu_git_post() {
|
||||
for fname in api master minion syndic; do
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && \
|
||||
([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then
|
||||
|
@ -2641,14 +2641,14 @@ install_ubuntu_restart_daemons() {
|
|||
elif [ -f /sbin/initctl ]; then
|
||||
/sbin/initctl reload-configuration
|
||||
fi
|
||||
for fname in minion master syndic api; do
|
||||
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then
|
||||
|
@ -2686,14 +2686,13 @@ install_ubuntu_restart_daemons() {
|
|||
}
|
||||
|
||||
install_ubuntu_check_services() {
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then
|
||||
|
@ -2704,6 +2703,7 @@ install_ubuntu_check_services() {
|
|||
__check_services_debian salt-$fname || return 1
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
#
|
||||
|
@ -3066,7 +3066,7 @@ install_debian_8_git() {
|
|||
}
|
||||
|
||||
install_debian_git_post() {
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip if not meant to be installed
|
||||
[ "$fname" = "api" ] && \
|
||||
([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
|
@ -3116,22 +3116,21 @@ install_debian_git_post() {
|
|||
|
||||
update-rc.d "salt-${fname}" defaults
|
||||
fi
|
||||
|
||||
done
|
||||
}
|
||||
|
||||
install_debian_restart_daemons() {
|
||||
[ "$_START_DAEMONS" -eq $BS_FALSE ] && return 0
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ ! -f "/etc/init.d/salt-$fname" ]) && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ]; then
|
||||
# Debian 8 uses systemd
|
||||
/bin/systemctl stop salt-$fname > /dev/null 2>&1
|
||||
|
@ -3145,7 +3144,7 @@ install_debian_restart_daemons() {
|
|||
}
|
||||
|
||||
install_debian_check_services() {
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
|
@ -3239,7 +3238,7 @@ install_fedora_stable() {
|
|||
}
|
||||
|
||||
install_fedora_stable_post() {
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
|
@ -3313,12 +3312,12 @@ install_fedora_git() {
|
|||
}
|
||||
|
||||
install_fedora_git_post() {
|
||||
for fname in minion master syndic api; do
|
||||
|
||||
for fname in api master minion syndic; do
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && \
|
||||
([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"
|
||||
|
@ -3335,14 +3334,13 @@ install_fedora_git_post() {
|
|||
install_fedora_restart_daemons() {
|
||||
[ $_START_DAEMONS -eq $BS_FALSE ] && return
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
systemctl stop salt-$fname > /dev/null 2>&1
|
||||
|
@ -3351,17 +3349,18 @@ install_fedora_restart_daemons() {
|
|||
}
|
||||
|
||||
install_fedora_check_services() {
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
__check_services_systemd salt-$fname || return 1
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
#
|
||||
|
@ -4295,12 +4294,12 @@ install_arch_linux_git() {
|
|||
}
|
||||
|
||||
install_arch_linux_post() {
|
||||
for fname in minion master syndic api; do
|
||||
|
||||
for fname in api master minion syndic; do
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && \
|
||||
([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
# Since Arch's pacman renames configuration files
|
||||
|
@ -4330,13 +4329,12 @@ install_arch_linux_post() {
|
|||
}
|
||||
|
||||
install_arch_linux_git_post() {
|
||||
for fname in minion master syndic api; do
|
||||
|
||||
for fname in api master minion syndic; do
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && \
|
||||
([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /usr/bin/systemctl ]; then
|
||||
|
@ -4363,7 +4361,7 @@ install_arch_linux_git_post() {
|
|||
install_arch_linux_restart_daemons() {
|
||||
[ $_START_DAEMONS -eq $BS_FALSE ] && return
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
|
@ -4377,6 +4375,7 @@ install_arch_linux_restart_daemons() {
|
|||
/usr/bin/systemctl start salt-$fname.service
|
||||
continue
|
||||
fi
|
||||
|
||||
/etc/rc.d/salt-$fname stop > /dev/null 2>&1
|
||||
/etc/rc.d/salt-$fname start
|
||||
done
|
||||
|
@ -4388,7 +4387,7 @@ install_arch_check_services() {
|
|||
return 0
|
||||
fi
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
|
@ -4399,6 +4398,7 @@ install_arch_check_services() {
|
|||
|
||||
__check_services_systemd salt-$fname || return 1
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
#
|
||||
|
@ -4654,15 +4654,13 @@ install_freebsd_git() {
|
|||
}
|
||||
|
||||
install_freebsd_9_stable_post() {
|
||||
for fname in minion master syndic api; do
|
||||
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
enable_string="salt_${fname}_enable=\"YES\""
|
||||
|
@ -4673,7 +4671,6 @@ install_freebsd_9_stable_post() {
|
|||
grep "salt_minion_paths" /etc/rc.conf >/dev/null 2>&1
|
||||
[ $? -eq 1 ] && echo "salt_minion_paths=\"/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin\"" >> /etc/rc.conf
|
||||
fi
|
||||
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -4693,14 +4690,13 @@ install_freebsd_git_post() {
|
|||
install_freebsd_restart_daemons() {
|
||||
[ $_START_DAEMONS -eq $BS_FALSE ] && return
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
service salt_$fname stop > /dev/null 2>&1
|
||||
|
@ -4778,13 +4774,13 @@ install_openbsd_deps() {
|
|||
_TEMP_CONFIG_DIR="/tmp"
|
||||
CONFIG_SALT_FUNC="config_salt"
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since there is no example config for it in the Salt git repo
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && \
|
||||
([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || __check_command_exists "salt-${fname}") && \
|
||||
continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
# Let's download, since they were not provided, the default configuration files
|
||||
|
@ -4794,6 +4790,7 @@ install_openbsd_deps() {
|
|||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "${_EXTRA_PACKAGES}" != "" ]; then
|
||||
echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}"
|
||||
# shellcheck disable=SC2086
|
||||
|
@ -4838,7 +4835,6 @@ install_openbsd_git() {
|
|||
return 0
|
||||
}
|
||||
|
||||
|
||||
install_openbsd_post() {
|
||||
#
|
||||
# Install rc.d files.
|
||||
|
@ -4855,7 +4851,8 @@ install_openbsd_post() {
|
|||
_TEMP_CONFIG_DIR="/tmp"
|
||||
for fname in api master minion syndic; do
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "api" ] || ! __check_command_exists "salt-${fname}" && continue
|
||||
[ $fname = "api" ] && \
|
||||
([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && continue
|
||||
|
@ -4872,6 +4869,8 @@ install_openbsd_post() {
|
|||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
install_openbsd_check_services() {
|
||||
|
@ -4892,7 +4891,6 @@ install_openbsd_check_services() {
|
|||
return 0
|
||||
}
|
||||
|
||||
|
||||
install_openbsd_restart_daemons() {
|
||||
[ $_START_DAEMONS -eq $BS_FALSE ] && return
|
||||
|
||||
|
@ -4904,13 +4902,15 @@ install_openbsd_restart_daemons() {
|
|||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f "/etc/rc.d/salt_${fname}" ]; then
|
||||
/etc/rc.d/salt_${fname} stop > /dev/null 2>&1
|
||||
/etc/rc.d/salt_${fname} start
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# Ended OpenBSD Install Functions
|
||||
|
@ -5004,9 +5004,9 @@ install_smartos_git() {
|
|||
|
||||
install_smartos_post() {
|
||||
smf_dir="/opt/custom/smf"
|
||||
# Install manifest files if needed.
|
||||
for fname in minion master syndic api; do
|
||||
|
||||
# Install manifest files if needed.
|
||||
for fname in api master minion syndic; do
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "api" ] && \
|
||||
([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
|
@ -5032,17 +5032,20 @@ install_smartos_post() {
|
|||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
install_smartos_git_post() {
|
||||
smf_dir="/opt/custom/smf"
|
||||
# Install manifest files if needed.
|
||||
for fname in minion master syndic api; do
|
||||
|
||||
# Install manifest files if needed.
|
||||
for fname in api master minion syndic; do
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && \
|
||||
([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
svcs "network/salt-$fname" > /dev/null 2>&1
|
||||
|
@ -5058,25 +5061,28 @@ install_smartos_git_post() {
|
|||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
install_smartos_restart_daemons() {
|
||||
[ $_START_DAEMONS -eq $BS_FALSE ] && return
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
# Stop if running && Start service
|
||||
svcadm disable salt-$fname > /dev/null 2>&1
|
||||
svcadm enable salt-$fname
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
#
|
||||
# Ended SmartOS Install Functions
|
||||
|
@ -5248,14 +5254,13 @@ install_opensuse_git() {
|
|||
}
|
||||
|
||||
install_opensuse_stable_post() {
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ]; then
|
||||
|
@ -5267,21 +5272,23 @@ install_opensuse_stable_post() {
|
|||
|
||||
/sbin/chkconfig --add salt-$fname
|
||||
/sbin/chkconfig salt-$fname on
|
||||
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
install_opensuse_git_post() {
|
||||
for fname in minion master syndic api; do
|
||||
|
||||
for fname in api master minion syndic; do
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && \
|
||||
([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ]; then
|
||||
use_usr_lib=$BS_FALSE
|
||||
|
||||
if [ "${DISTRO_MAJOR_VERSION}" -gt 13 ] || ([ "${DISTRO_MAJOR_VERSION}" -eq 13 ] && [ "${DISTRO_MINOR_VERSION}" -ge 2 ]); then
|
||||
use_usr_lib=$BS_TRUE
|
||||
fi
|
||||
|
@ -5295,28 +5302,29 @@ install_opensuse_git_post() {
|
|||
else
|
||||
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"
|
||||
fi
|
||||
|
||||
continue
|
||||
fi
|
||||
|
||||
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-$fname" "/etc/init.d/salt-$fname"
|
||||
chmod +x /etc/init.d/salt-$fname
|
||||
|
||||
done
|
||||
|
||||
install_opensuse_stable_post
|
||||
install_opensuse_stable_post || return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
install_opensuse_restart_daemons() {
|
||||
[ $_START_DAEMONS -eq $BS_FALSE ] && return
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ]; then
|
||||
|
@ -5336,17 +5344,18 @@ install_opensuse_check_services() {
|
|||
return 0
|
||||
fi
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
__check_services_systemd salt-$fname > /dev/null 2>&1 || __check_services_systemd salt-$fname.service > /dev/null 2>&1 || return 1
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
#
|
||||
|
@ -5425,12 +5434,13 @@ install_suse_12_stable_deps() {
|
|||
_TEMP_CONFIG_DIR="/tmp"
|
||||
CONFIG_SALT_FUNC="config_salt"
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since there is no example config for it in the Salt git repo
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
# Syndic uses the same configuration file as the master
|
||||
|
@ -5511,12 +5521,12 @@ install_suse_12_stable_post() {
|
|||
if [ "$SUSE_PATCHLEVEL" -gt 1 ]; then
|
||||
install_opensuse_stable_post || return 1
|
||||
else
|
||||
for fname in minion master syndic api; do
|
||||
|
||||
for fname in api master minion syndic; do
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && \
|
||||
([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ]; then
|
||||
|
@ -5526,20 +5536,17 @@ install_suse_12_stable_post() {
|
|||
continue
|
||||
fi
|
||||
|
||||
## shellcheck disable=SC2086
|
||||
#curl $_CURL_ARGS -L "https://github.com/saltstack/salt/raw/develop/pkg/rpm/salt-$fname" \
|
||||
# -o "/etc/init.d/salt-$fname" || return 1
|
||||
#chmod +x "/etc/init.d/salt-$fname"
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ]; then
|
||||
systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service)
|
||||
sleep 0.1
|
||||
systemctl daemon-reload
|
||||
continue
|
||||
fi
|
||||
|
||||
done
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -5619,12 +5626,13 @@ install_suse_11_stable_deps() {
|
|||
_TEMP_CONFIG_DIR="/tmp"
|
||||
CONFIG_SALT_FUNC="config_salt"
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since there is no example config for it in the Salt git repo
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
# Syndic uses the same configuration file as the master
|
||||
|
@ -5704,12 +5712,12 @@ install_suse_11_stable_post() {
|
|||
if [ "$SUSE_PATCHLEVEL" -gt 1 ]; then
|
||||
install_opensuse_stable_post || return 1
|
||||
else
|
||||
for fname in minion master syndic api; do
|
||||
|
||||
for fname in api master minion syndic; do
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && \
|
||||
([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -f /bin/systemctl ]; then
|
||||
|
@ -5756,17 +5764,18 @@ install_suse_check_services() {
|
|||
return 0
|
||||
fi
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
__check_services_systemd salt-$fname || return 1
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -5855,14 +5864,13 @@ install_gentoo_git() {
|
|||
}
|
||||
|
||||
install_gentoo_post() {
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -d "/run/systemd/system" ]; then
|
||||
|
@ -5878,14 +5886,13 @@ install_gentoo_post() {
|
|||
install_gentoo_restart_daemons() {
|
||||
[ $_START_DAEMONS -eq $BS_FALSE ] && return
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ -d "/run/systemd/system" ]; then
|
||||
|
@ -5904,17 +5911,18 @@ install_gentoo_check_services() {
|
|||
return 0
|
||||
fi
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
#[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
__check_services_systemd salt-$fname || return 1
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
#
|
||||
|
@ -6126,7 +6134,7 @@ daemons_running() {
|
|||
[ "$_START_DAEMONS" -eq $BS_FALSE ] && return 0
|
||||
|
||||
FAILED_DAEMONS=0
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
|
@ -6146,6 +6154,7 @@ daemons_running() {
|
|||
FAILED_DAEMONS=$((FAILED_DAEMONS + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
return $FAILED_DAEMONS
|
||||
}
|
||||
#
|
||||
|
@ -6426,13 +6435,13 @@ if [ "$DAEMONS_RUNNING_FUNC" != "null" ] && [ ${_START_DAEMONS} -eq $BS_TRUE ];
|
|||
if [ $? -ne 0 ]; then
|
||||
echoerror "Failed to run ${DAEMONS_RUNNING_FUNC}()!!!"
|
||||
|
||||
for fname in minion master syndic api; do
|
||||
for fname in api master minion syndic; do
|
||||
# Skip salt-api since the service should be opt-in and not necessarily started on boot
|
||||
[ $fname = "api" ] && continue
|
||||
|
||||
# Skip if not meant to be installed
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
|
||||
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
|
||||
|
||||
if [ "$_ECHO_DEBUG" -eq $BS_FALSE ]; then
|
||||
|
|
Loading…
Add table
Reference in a new issue