|
17 | 17 | # CREATED: 10/15/2012 09:49:37 PM WEST |
18 | 18 | #====================================================================================================================== |
19 | 19 | set -o nounset # Treat unset variables as an error |
20 | | -__ScriptVersion="2014.08.23" |
| 20 | +__ScriptVersion="2014.08.30" |
21 | 21 | __ScriptName="bootstrap-salt.sh" |
22 | 22 |
|
23 | 23 | #====================================================================================================================== |
@@ -702,6 +702,9 @@ __gather_linux_system_info() { |
702 | 702 | DISTRO_NAME="Oracle Linux" |
703 | 703 | elif [ "${DISTRO_NAME}" = "AmazonAMI" ]; then |
704 | 704 | DISTRO_NAME="Amazon Linux AMI" |
| 705 | + elif [ "${DISTRO_NAME}" = "Arch" ]; then |
| 706 | + DISTRO_NAME="Arch Linux" |
| 707 | + return |
705 | 708 | fi |
706 | 709 | rv=$(lsb_release -sr) |
707 | 710 | [ "${rv}" != "" ] && DISTRO_VERSION=$(__parse_version_string "$rv") |
@@ -1871,10 +1874,13 @@ install_ubuntu_restart_daemons() { |
1871 | 1874 |
|
1872 | 1875 | install_ubuntu_check_services() { |
1873 | 1876 | for fname in minion master syndic api; do |
| 1877 | + # Skip salt-api since the service should be opt-in and not necessarily started on boot |
| 1878 | + [ $fname = "api" ] && continue |
| 1879 | + |
1874 | 1880 | # Skip if not meant to be installed |
1875 | 1881 | [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue |
1876 | 1882 | [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue |
1877 | | - [ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
| 1883 | + #[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
1878 | 1884 | [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue |
1879 | 1885 | if [ -f /sbin/initctl ] && [ -f /etc/init/salt-${fname}.conf ]; then |
1880 | 1886 | __check_services_upstart salt-$fname || return 1 |
@@ -2314,10 +2320,13 @@ install_debian_restart_daemons() { |
2314 | 2320 |
|
2315 | 2321 | install_debian_check_services() { |
2316 | 2322 | for fname in minion master syndic api; do |
| 2323 | + # Skip salt-api since the service should be opt-in and not necessarily started on boot |
| 2324 | + [ $fname = "api" ] && continue |
| 2325 | + |
2317 | 2326 | # Skip if not meant to be installed |
2318 | 2327 | [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue |
2319 | 2328 | [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue |
2320 | | - [ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ ! -f "/etc/init.d/salt-$fname" ]) && continue |
| 2329 | + #[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ ! -f "/etc/init.d/salt-$fname" ]) && continue |
2321 | 2330 | [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue |
2322 | 2331 | __check_services_debian salt-$fname || return 1 |
2323 | 2332 | done |
@@ -2441,10 +2450,13 @@ install_fedora_restart_daemons() { |
2441 | 2450 |
|
2442 | 2451 | install_fedora_check_services() { |
2443 | 2452 | for fname in minion master syndic api; do |
| 2453 | + # Skip salt-api since the service should be opt-in and not necessarily started on boot |
| 2454 | + [ $fname = "api" ] && continue |
| 2455 | + |
2444 | 2456 | # Skip if not meant to be installed |
2445 | 2457 | [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue |
2446 | 2458 | [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue |
2447 | | - [ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
| 2459 | + #[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
2448 | 2460 | [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue |
2449 | 2461 | __check_services_systemd salt-$fname || return 1 |
2450 | 2462 | done |
@@ -2483,7 +2495,7 @@ __install_epel_repository() { |
2483 | 2495 | elif [ "$DISTRO_MAJOR_VERSION" -eq 6 ]; then |
2484 | 2496 | rpm -Uvh --force "http://download.fedoraproject.org/pub/epel/6/${EPEL_ARCH}/epel-release-6-8.noarch.rpm" || return 1 |
2485 | 2497 | elif [ "$DISTRO_MAJOR_VERSION" -eq 7 ]; then |
2486 | | - rpm -Uvh --force "http://download.fedoraproject.org/pub/epel/beta/7/${EPEL_ARCH}/epel-release-7-0.2.noarch.rpm" || return 1 |
| 2498 | + rpm -Uvh --force "http://download.fedoraproject.org/pub/epel/7/${EPEL_ARCH}/epel-release-7-1.noarch.rpm" || return 1 |
2487 | 2499 | else |
2488 | 2500 | echoerror "Failed add EPEL repository support." |
2489 | 2501 | return 1 |
@@ -2632,11 +2644,12 @@ install_centos_git() { |
2632 | 2644 | } |
2633 | 2645 |
|
2634 | 2646 | install_centos_git_post() { |
2635 | | - for fname in master minion syndic; do |
| 2647 | + for fname in minion master minion api; do |
2636 | 2648 |
|
2637 | 2649 | # Skip if not meant to be installed |
2638 | 2650 | [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue |
2639 | 2651 | [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue |
| 2652 | + [ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
2640 | 2653 | [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue |
2641 | 2654 |
|
2642 | 2655 | # While the RPM's use init.d, so will we. |
@@ -2718,10 +2731,13 @@ install_centos_testing_post() { |
2718 | 2731 |
|
2719 | 2732 | install_centos_check_services() { |
2720 | 2733 | for fname in minion master syndic api; do |
| 2734 | + # Skip salt-api since the service should be opt-in and not necessarily started on boot |
| 2735 | + [ $fname = "api" ] && continue |
| 2736 | + |
2721 | 2737 | # Skip if not meant to be installed |
2722 | 2738 | [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue |
2723 | 2739 | [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue |
2724 | | - [ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
| 2740 | + #[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
2725 | 2741 | [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue |
2726 | 2742 | if [ -f /sbin/initctl ] && [ -f /etc/init/salt-${fname}.conf ]; then |
2727 | 2743 | __check_services_upstart salt-$fname || return 1 |
@@ -2765,7 +2781,7 @@ __test_rhel_optionals_packages() { |
2765 | 2781 | yum --config "${__YUM_CONF_FILE}" install -y ${package} --enablerepo=${_EPEL_REPO} >/dev/null 2>&1 |
2766 | 2782 | fi |
2767 | 2783 | if [ $? -ne 0 ]; then |
2768 | | - echoerror "Failed to find an installable '${package}' package. The optional repository or it's subscription might be missing." |
| 2784 | + echoerror "Failed to find an installable '${package}' package. The optional repository or its subscription might be missing." |
2769 | 2785 | rm -rf "${__YUM_CONF_DIR}" |
2770 | 2786 | return 1 |
2771 | 2787 | fi |
@@ -3409,10 +3425,13 @@ install_arch_check_services() { |
3409 | 3425 | fi |
3410 | 3426 |
|
3411 | 3427 | for fname in minion master syndic api; do |
| 3428 | + # Skip salt-api since the service should be opt-in and not necessarily started on boot |
| 3429 | + [ $fname = "api" ] && continue |
| 3430 | + |
3412 | 3431 | # Skip if not meant to be installed |
3413 | 3432 | [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue |
3414 | 3433 | [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue |
3415 | | - [ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
| 3434 | + #[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
3416 | 3435 | [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue |
3417 | 3436 | __check_services_systemd salt-$fname || return 1 |
3418 | 3437 | done |
@@ -3822,7 +3841,7 @@ install_opensuse_stable_deps() { |
3822 | 3841 |
|
3823 | 3842 | zypper --gpg-auto-import-keys --non-interactive refresh |
3824 | 3843 | if [ $? -ne 0 ] && [ $? -ne 4 ]; then |
3825 | | - # If the exit code is not 0, and it's not 4(failed to update a |
| 3844 | + # If the exit code is not 0, and it's not 4 (failed to update a |
3826 | 3845 | # repository) return a failure. Otherwise continue. |
3827 | 3846 | return 1 |
3828 | 3847 | fi |
@@ -3967,10 +3986,13 @@ install_opensuse_check_services() { |
3967 | 3986 | fi |
3968 | 3987 |
|
3969 | 3988 | for fname in minion master syndic api; do |
| 3989 | + # Skip salt-api since the service should be opt-in and not necessarily started on boot |
| 3990 | + [ $fname = "api" ] && continue |
| 3991 | + |
3970 | 3992 | # Skip if not meant to be installed |
3971 | 3993 | [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue |
3972 | 3994 | [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue |
3973 | | - [ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
| 3995 | + #[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
3974 | 3996 | [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue |
3975 | 3997 | __check_services_systemd salt-$fname > /dev/null 2>&1 || __check_services_systemd salt-$fname.service > /dev/null 2>&1 || return 1 |
3976 | 3998 | done |
@@ -4152,10 +4174,13 @@ install_suse_check_services() { |
4152 | 4174 | fi |
4153 | 4175 |
|
4154 | 4176 | for fname in minion master syndic api; do |
| 4177 | + # Skip salt-api since the service should be opt-in and not necessarily started on boot |
| 4178 | + [ $fname = "api" ] && continue |
| 4179 | + |
4155 | 4180 | # Skip if not meant to be installed |
4156 | 4181 | [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue |
4157 | 4182 | [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue |
4158 | | - [ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
| 4183 | + #[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
4159 | 4184 | [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue |
4160 | 4185 | __check_services_systemd salt-$fname || return 1 |
4161 | 4186 | done |
@@ -4294,10 +4319,13 @@ install_gentoo_check_services() { |
4294 | 4319 | fi |
4295 | 4320 |
|
4296 | 4321 | for fname in minion master syndic api; do |
| 4322 | + # Skip salt-api since the service should be opt-in and not necessarily started on boot |
| 4323 | + [ $fname = "api" ] && continue |
| 4324 | + |
4297 | 4325 | # Skip if not meant to be installed |
4298 | 4326 | [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue |
4299 | 4327 | [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue |
4300 | | - [ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
| 4328 | + #[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue |
4301 | 4329 | [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue |
4302 | 4330 | __check_services_systemd salt-$fname || return 1 |
4303 | 4331 | done |
|
0 commit comments