mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
Merge pull request #7744 from zmerlynn/allow_builtin_salt
Skip SaltStack install if it's already installed
This commit is contained in:
commit
9718d667a7
@ -104,6 +104,11 @@ download-or-bust() {
|
|||||||
# Install salt from GCS. See README.md for instructions on how to update these
|
# Install salt from GCS. See README.md for instructions on how to update these
|
||||||
# debs.
|
# debs.
|
||||||
install-salt() {
|
install-salt() {
|
||||||
|
if dpkg -s salt-minion &>/dev/null; then
|
||||||
|
echo "== SaltStack already installed, skipping install step =="
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
echo "== Refreshing package database =="
|
echo "== Refreshing package database =="
|
||||||
until apt-get update; do
|
until apt-get update; do
|
||||||
echo "== apt-get update failed, retrying =="
|
echo "== apt-get update failed, retrying =="
|
||||||
@ -158,16 +163,22 @@ EOF
|
|||||||
echo "== Finished installing Salt =="
|
echo "== Finished installing Salt =="
|
||||||
}
|
}
|
||||||
|
|
||||||
# Ensure salt-minion never runs
|
# Ensure salt-minion isn't running and never runs
|
||||||
stop-salt-minion() {
|
stop-salt-minion() {
|
||||||
|
if [[ -e /etc/init/salt-minion.override ]]; then
|
||||||
|
# Assume this has already run (upgrade, or baked into containervm)
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
# This ensures it on next reboot
|
# This ensures it on next reboot
|
||||||
echo manual > /etc/init/salt-minion.override
|
echo manual > /etc/init/salt-minion.override
|
||||||
update-rc.d salt-minion disable
|
update-rc.d salt-minion disable
|
||||||
|
|
||||||
if service salt-minion status >/dev/null; then
|
while service salt-minion status >/dev/null; do
|
||||||
echo "salt-minion started in defiance of runlevel policy, aborting startup." >&2
|
echo "salt-minion found running, stopping"
|
||||||
return 1
|
service salt-minion stop
|
||||||
fi
|
sleep 1
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mounts a persistent disk (formatting if needed) to store the persistent data
|
# Mounts a persistent disk (formatting if needed) to store the persistent data
|
||||||
|
Loading…
Reference in New Issue
Block a user