salt bootstrap script 支持用户在各种系统中安装 master 和 minion,shell 脚本名称是 bootstrap-salt.sh,脚本里会有一系统的检查操作来确定操作系统的版本和类型,然后先把适当的方法安装 salt 二进制文件。bootstrap script 会安装最小数量的salt 依赖包,也就是尽可能的轻量化安装。它会在系统上存在了 salt 二进制文件后安装其他依赖的包。脚本地址 https://github.com/saltstack/salt-bootstrap
脚本安装支持大部分的 linux 发行版环境
使用 curl 通过 github 安装最新版本:
curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com sudo sh bootstrap-salt.sh git develop
安装指定版本:
curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com sudo sh bootstrap-salt.sh git v2015.8.8
安装 master:
curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com sudo sh bootstrap-salt.sh -M -N git develop
使用 wget 安装:
wget -O bootstrap-salt.sh https://bootstrap.saltstack.com sudo sh bootstrap-salt.sh
使用一行命令安装:
curl -L https://bootstrap.saltstack.com | sudo sh
wget -O - https://bootstrap.saltstack.com | sudo sh
脚本安装命令选项:
$ sh bootstrap-salt.sh -h Usage : bootstrap-salt.sh [options] <install-type> <install-type-args> Installation types: - stable (default) - stable [version] (ubuntu specific) - daily (ubuntu specific) - testing (redhat specific) - git Examples: - bootstrap-salt.sh - bootstrap-salt.sh stable - bootstrap-salt.sh stable 2014.7 - bootstrap-salt.sh daily - bootstrap-salt.sh testing - bootstrap-salt.sh git - bootstrap-salt.sh git develop - bootstrap-salt.sh git v0.17.0 - bootstrap-salt.sh git 8c3fadf15ec183e5ce8c63739850d543617e4357 Options: -h Display this message # 显示帮助 -v Display script version # 显示脚本版本 -n No colours. -D Show debug output. # 显示debug输出 -c Temporary configuration directory -g Salt repository URL. (default: git://github.com/saltstack/salt.git) # 指定salt repo 地址 -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) -k Temporary directory holding the minion keys which will pre-seed the master. -s Sleep time used when waiting for daemons to start, restart and when checking for the services running. Default: 3 -M Also install salt-master # 总是安装 master -S Also install salt-syndic -N Do not install salt-minion # 总是安装 minion -X Do not start daemons after installation -C Only run the configuration function. This option automatically bypasses any installation. -P Allow pip based installations. On some distributions the required salt packages or its dependencies are not available as a package for that distribution. Using this flag allows the script to use pip as a last resort method. NOTE: This only works for functions which actually implement pip based installations. -F Allow copied files to overwrite existing(config, init.d, etc) -U If set, fully upgrade the system prior to bootstrapping salt -K If set, keep the temporary files in the temporary directories specified with -c and -k. -I If set, allow insecure connections while downloading any files. For example, pass '--no-check-certificate' to 'wget' or '--insecure' to 'curl' -A Pass the salt-master DNS name or IP. This will be stored under ${BS_SALT_ETC_DIR}/minion.d/99-master-address.conf -i Pass the salt-minion id. This will be stored under ${BS_SALT_ETC_DIR}/minion_id -L Install the Apache Libcloud package if possible(required for salt-cloud) -p Extra-package to install while installing salt dependencies. One package per -p flag. You're responsible for providing the proper package name. -d Disable check_service functions. Setting this flag disables the 'install_<distro>_check_services' checks. You can also do this by touching /tmp/disable_salt_checks on the target host. Defaults ${BS_FALSE} -H Use the specified http proxy for the installation -Z Enable external software source for newer ZeroMQ(Only available for RHEL/CentOS/Fedora/Ubuntu based distributions) -b Assume that dependencies are already installed and software sources are set up. If git is selected, git tree is still checked out as dependency step.