mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-17 02:00:22 +00:00
commit
cd2c5b57d5
2 changed files with 218 additions and 130 deletions
335
README.rst
335
README.rst
|
@ -2,93 +2,141 @@
|
|||
Bootstrapping Salt
|
||||
==================
|
||||
|
||||
Before `Salt`_ can be used for provisioning on the desired machine, the binaries need to be
|
||||
installed. Since `Salt`_ supports many different distributions and versions of operating systems,
|
||||
the `Salt`_ installation process is handled by this shell script ``bootstrap-salt.sh``. This
|
||||
script runs through a series of checks to determine operating system type and version to then
|
||||
Before `Salt`_ can be used for provisioning on the desired machine, the binaries need to be
|
||||
installed. Since `Salt`_ supports many different distributions and versions of operating systems,
|
||||
the `Salt`_ installation process is handled by this shell script ``bootstrap-salt.sh``. This
|
||||
script runs through a series of checks to determine operating system type and version to then
|
||||
install the `Salt`_ binaries using the appropriate methods.
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
This ``README`` file is not the absolute truth to what the bootstrap script is capable of, for
|
||||
that, please read the generated help by passing ``-h`` to the script or even better, `read the
|
||||
This ``README`` file is not the absolute truth to what the bootstrap script is capable of, for
|
||||
that, please read the generated help by passing ``-h`` to the script or even better, `read the
|
||||
source`_.
|
||||
|
||||
**In case you found a bug, please read** `I Found a Bug`_ **first before submitting a new issue.**
|
||||
The examples there show how to get the latest development version of the bootstrap script. Chances
|
||||
are high that your issue was already fixed.
|
||||
|
||||
.. _`Salt`: https://saltstack.com/community/
|
||||
.. _`read the source`: https://github.com/saltstack/salt-bootstrap/blob/develop/bootstrap-salt.sh
|
||||
|
||||
|
||||
**In case you found a bug, please read** `I found a bug`_ **first before submitting a new issue.**
|
||||
|
||||
|
||||
|
||||
Bootstrap
|
||||
---------
|
||||
=========
|
||||
|
||||
If you're looking for the *one-liner* to install salt, please scroll to the bottom and use the
|
||||
instructions for `Installing via an Insecure One-Liner`_.
|
||||
|
||||
.. note::
|
||||
|
||||
In every two-step example, you would be well-served to examine the downloaded file and examine
|
||||
it to ensure that it does what you expect.
|
||||
|
||||
|
||||
Examples
|
||||
~~~~~~~~
|
||||
--------
|
||||
|
||||
.. note::
|
||||
|
||||
In every two-step example, you would be well-served to examine the downloaded file and examine
|
||||
it to ensure that it does what you expect.
|
||||
These examples below show how to bootstrap Salt directly from GitHub or other Git repository.
|
||||
Run the script without any parameters to get latest stable Salt packages for your system from
|
||||
`SaltStack corporate repository`_. See first example in the `Install using wget`_ section.
|
||||
|
||||
.. _`SaltStack corporate repository`: https://repo.saltstack.com/
|
||||
|
||||
|
||||
Using ``curl`` to install latest git:
|
||||
Install using curl
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Using ``curl`` to install latest development version from GitHub:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -L https://bootstrap.saltstack.com -o install_salt.sh
|
||||
sudo sh install_salt.sh git develop
|
||||
curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com
|
||||
sudo sh bootstrap_salt.sh git develop
|
||||
|
||||
If you want to install a specific release version (based on the Git tags):
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com
|
||||
sudo sh bootstrap_salt.sh git v2015.8.7
|
||||
|
||||
To install a specific branch from a Git fork:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com
|
||||
sudo sh bootstrap_salt.sh -g https://github.com/myuser/salt.git git mybranch
|
||||
|
||||
If all you want is to install a ``salt-master`` using latest Git:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com
|
||||
sudo sh bootstrap_salt.sh -M -N git develop
|
||||
|
||||
If your host has Internet access only via HTTP proxy:
|
||||
|
||||
.. code:: console
|
||||
|
||||
PROXY='http://user:password@myproxy.example.com:3128'
|
||||
curl -o bootstrap_salt.sh -L -x "$PROXY" https://bootstrap.saltstack.com
|
||||
sudo sh bootstrap_salt.sh -G -H "$PROXY" git
|
||||
|
||||
|
||||
Install using wget
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Using ``wget`` to install your distribution's stable packages:
|
||||
|
||||
.. code:: console
|
||||
|
||||
wget -O install_salt.sh https://bootstrap.saltstack.com
|
||||
sudo sh install_salt.sh
|
||||
|
||||
wget -O bootstrap_salt.sh https://bootstrap.saltstack.com
|
||||
sudo sh bootstrap_salt.sh
|
||||
|
||||
Install a specific version from git using ``wget``:
|
||||
|
||||
.. code:: console
|
||||
|
||||
wget -O install_salt.sh https://bootstrap.saltstack.com
|
||||
sudo sh install_salt.sh -P git v0.16.4
|
||||
wget -O bootstrap_salt.sh https://bootstrap.saltstack.com
|
||||
sudo sh bootstrap_salt.sh -P git v2015.8.7
|
||||
|
||||
On the above example we added `-P` which will allow PIP packages to be installed if required but
|
||||
it's no a necessary flag for git based bootstraps.
|
||||
.. note::
|
||||
|
||||
On the above example we added `-P` which will allow PIP packages to be installed if required but
|
||||
it's not a necessary flag for Git based bootstraps.
|
||||
|
||||
|
||||
If you already have python installed, ``python 2.6``, then it's as easy as:
|
||||
Install using Python
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you already have Python installed, ``python 2.6``, then it's as easy as:
|
||||
|
||||
.. code:: console
|
||||
|
||||
python -m urllib "https://bootstrap.saltstack.com" > install_salt.sh
|
||||
sudo sh install_salt.sh git develop
|
||||
python -m urllib "https://bootstrap.saltstack.com" > bootstrap_salt.sh
|
||||
sudo sh bootstrap_salt.sh git develop
|
||||
|
||||
|
||||
All python versions should support the following one liner:
|
||||
All Python versions should support the following one liner:
|
||||
|
||||
.. code:: console
|
||||
|
||||
python -c 'import urllib; print urllib.urlopen("https://bootstrap.saltstack.com").read()' > install_salt.sh
|
||||
sudo sh install_salt.sh git develop
|
||||
python -c 'import urllib; print urllib.urlopen("https://bootstrap.saltstack.com").read()' > bootstrap_salt.sh
|
||||
sudo sh bootstrap_salt.sh git develop
|
||||
|
||||
|
||||
On a FreeBSD base system you usually don't have either of the above binaries available. You **do**
|
||||
Install using fetch
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
On a FreeBSD base system you usually don't have either of the above binaries available. You **do**
|
||||
have ``fetch`` available though:
|
||||
|
||||
.. code:: console
|
||||
|
||||
fetch -o install_salt.sh https://bootstrap.saltstack.com
|
||||
sudo sh install_salt.sh
|
||||
fetch -o bootstrap_salt.sh https://bootstrap.saltstack.com
|
||||
sudo sh bootstrap_salt.sh
|
||||
|
||||
If you have any SSL issues install ``ca_root_nssp``:
|
||||
|
||||
|
@ -109,34 +157,6 @@ Or link them to the right place:
|
|||
ln -s /usr/local/share/certs/ca-root-nss.crt /etc/ssl/cert.pem
|
||||
|
||||
|
||||
If all you want is to install a ``salt-master`` using latest git:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o install_salt.sh -L https://bootstrap.saltstack.com
|
||||
sudo sh install_salt.sh -M -N git develop
|
||||
|
||||
|
||||
If you want to install a specific release version (based on the git tags):
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o install_salt.sh -L https://bootstrap.saltstack.com
|
||||
sudo sh install_salt.sh git v0.16.4
|
||||
|
||||
|
||||
To install a specific branch from a git fork:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o install_salt.sh -L https://bootstrap.saltstack.com
|
||||
sudo sh install_salt.sh -g https://github.com/myuser/salt.git git mybranch
|
||||
|
||||
|
||||
Any of the example above which use two-lines can be made to run in a single-line
|
||||
configuration with minor modifications, see `Installing via an Insecure One-Liner`_.
|
||||
|
||||
|
||||
Installing via an Insecure One-Liner
|
||||
------------------------------------
|
||||
|
||||
|
@ -147,10 +167,6 @@ The following examples illustrate how to install Salt via a one-liner.
|
|||
Warning! These methods do not involve a verification step and assume that the delivered file
|
||||
is trustworthy.
|
||||
|
||||
|
||||
Examples
|
||||
~~~~~~~~
|
||||
|
||||
Installing the latest stable release of Salt (default):
|
||||
|
||||
.. code:: console
|
||||
|
@ -170,9 +186,110 @@ Installing the latest develop branch of Salt:
|
|||
curl -L https://bootstrap.saltstack.com | sudo sh -s -- git develop
|
||||
|
||||
|
||||
Adding support for other operating systems
|
||||
Supported Operating Systems
|
||||
---------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
Bootstrap may fail to install Salt on the cutting-edge version of distributions with frequent
|
||||
release cycle, such as: Amazon Linux, Fedora, openSUSE Tumbleweed or Ubuntu non-LTS. Check the
|
||||
versions from the list below. Also, see the `Unsupported Distro`_ and
|
||||
`Adding Support for Other Operating Systems`_ sections.
|
||||
|
||||
|
||||
Debian and derivatives
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Debian GNU/Linux 6/7/8
|
||||
- Linux Mint Debian Edition 1 (based on Debian 8)
|
||||
- Kali Linux 1.0 (based on Debian 7)
|
||||
|
||||
|
||||
Red Hat family
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
- Amazon Linux 2012.09/2013.03/2013.09/2014.03/2014.09
|
||||
- CentOS 5/6/7
|
||||
- Fedora 17/18/20/21/22
|
||||
- Oracle Linux 5/6/7
|
||||
- Red Hat Enterprise Linux 5/6/7
|
||||
- Scientific Linux 5/6/7
|
||||
|
||||
|
||||
SUSE family
|
||||
~~~~~~~~~~~
|
||||
|
||||
- openSUSE 12/13
|
||||
- openSUSE Leap 42
|
||||
- openSUSE Tumbleweed 2015
|
||||
- SUSE Linux Enterprise Server 11 SP1/11 SP2/11 SP3/12
|
||||
|
||||
|
||||
Ubuntu and derivatives
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Elementary OS 0.2 (based on Ubuntu 12.04)
|
||||
- Linaro 12.04
|
||||
- Linux Mint 13/14/16/17
|
||||
- Trisquel GNU/Linux 6 (based on Ubuntu 12.04)
|
||||
- Ubuntu 10.x/11.x/12.x/13.x/14.x/15.04
|
||||
|
||||
|
||||
Other Linux distro
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Arch Linux
|
||||
- Gentoo
|
||||
|
||||
|
||||
UNIX systems
|
||||
~~~~~~~~~~~~
|
||||
|
||||
**BSD**:
|
||||
|
||||
- OpenBSD (``pip`` installation)
|
||||
- FreeBSD 9/10/11
|
||||
|
||||
**SunOS**:
|
||||
|
||||
- SmartOS
|
||||
|
||||
|
||||
Unsupported Distro
|
||||
------------------
|
||||
|
||||
You found a Linux distribution which we still do not support or we do not correctly identify?
|
||||
Please run the following commands and report their output when creating a ticket:
|
||||
|
||||
.. code:: console
|
||||
|
||||
sudo find /etc/ -name \*-release -print -exec cat {} \;
|
||||
command lsb_release -a
|
||||
|
||||
|
||||
Adding Support for Other Operating Systems
|
||||
------------------------------------------
|
||||
In order to install salt for a distribution you need to define:
|
||||
|
||||
The following operating systems are detected, but Salt and its dependencies installation functions
|
||||
are not developed yet:
|
||||
|
||||
**BSD**:
|
||||
|
||||
- NetBSD
|
||||
|
||||
**Linux**:
|
||||
|
||||
- Raspbian (detected as Debian)
|
||||
- Slackware
|
||||
|
||||
**SunOS**
|
||||
|
||||
- OpenIndiana
|
||||
- Oracle Solaris
|
||||
- OmniOS (Illumos)
|
||||
|
||||
|
||||
In order to install Salt for a distribution you need to define:
|
||||
|
||||
1. To Install Dependencies, which is required, one of:
|
||||
|
||||
|
@ -186,8 +303,8 @@ In order to install salt for a distribution you need to define:
|
|||
install_<distro>_deps
|
||||
|
||||
|
||||
2. Optionally, define a minion configuration function, which will be called if the
|
||||
``-c|config-dir`` option is passed. One of:
|
||||
2. Optionally, define a minion configuration function, which will be called if the
|
||||
``-c`` option is passed. One of:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
|
@ -200,8 +317,8 @@ In order to install salt for a distribution you need to define:
|
|||
config_salt [THIS ONE IS ALREADY DEFINED AS THE DEFAULT]
|
||||
|
||||
|
||||
3. Optionally, define a salt master pre-seed function, which will be called if the -k (pre-seed
|
||||
master keys) option is passed. One of:
|
||||
3. Optionally, define a Salt master pre-seed function, which will be called if the
|
||||
``-k`` (pre-seed master keys) option is passed. One of:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
|
@ -249,7 +366,7 @@ In order to install salt for a distribution you need to define:
|
|||
|
||||
.. admonition:: Attention!
|
||||
|
||||
The start daemons function should be able to restart any daemons which are running, or start if
|
||||
The start daemons function should be able to restart any daemons which are running, or start if
|
||||
they're not running.
|
||||
|
||||
|
||||
|
@ -280,7 +397,7 @@ In order to install salt for a distribution you need to define:
|
|||
|
||||
----
|
||||
|
||||
Below is an example for Ubuntu Oneiric(the example may not be up to date with the script):
|
||||
Below is an example for Ubuntu Oneiric (the example may not be up to date with the script):
|
||||
|
||||
.. code:: bash
|
||||
|
||||
|
@ -328,44 +445,22 @@ Below is an example for Ubuntu Oneiric(the example may not be up to date with th
|
|||
|
||||
Since there is no ``install_ubuntu_11_10_stable()`` it defaults to the unspecified version script.
|
||||
|
||||
The bootstrapping script must be plain POSIX sh only, **not** bash or another shell script. By
|
||||
design the targeting for each operating system and version is very specific. Assumptions of
|
||||
The bootstrapping script must be plain POSIX ``sh`` only, **not** ``bash`` or another shell script.
|
||||
By design the targeting for each operating system and version is very specific. Assumptions of
|
||||
supported versions or variants should not be made, to avoid failed or broken installations.
|
||||
|
||||
Supported Operating Systems
|
||||
---------------------------
|
||||
- Amazon Linux 2012.09
|
||||
- Arch
|
||||
- CentOS 5/6/7
|
||||
- Debian 6/7/8
|
||||
- Fedora 17/18/20/21/22
|
||||
- FreeBSD 9.1/9.2/10/11
|
||||
- Gentoo
|
||||
- Linaro
|
||||
- Linux Mint 13/14
|
||||
- OpenSUSE 12/13
|
||||
- Oracle Linux 5/5
|
||||
- Red Hat 5/6
|
||||
- Red Hat Enterprise 5/6
|
||||
- Scientific Linux 5/6
|
||||
- SmartOS
|
||||
- SUSE Linux Enterprise 11 SP1/11 SP2/11 SP3
|
||||
- Ubuntu 10.x/11.x/12.x/13.x/14.x/15.04
|
||||
- Elementary OS 0.2
|
||||
|
||||
I Found a Bug
|
||||
=============
|
||||
|
||||
|
||||
I found a bug
|
||||
-------------
|
||||
|
||||
If you found a possible problem, or bug, please try to bootstrap using the develop version. The
|
||||
issue you are having might have already been fixed and it's just not yet included in the stable
|
||||
If you found a possible problem, or bug, please try to bootstrap using the develop version. The
|
||||
issue you are having might have already been fixed and it's just not yet included in the stable
|
||||
version.
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o install_salt.sh -L https://bootstrap.saltstack.com/develop
|
||||
sudo sh install_salt.sh git develop
|
||||
curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com/develop
|
||||
sudo sh bootstrap_salt.sh git develop
|
||||
|
||||
|
||||
Or the insecure one liner:
|
||||
|
@ -375,37 +470,25 @@ Or the insecure one liner:
|
|||
curl -L https://bootstrap.saltstack.com/develop | sudo sh -s -- git develop
|
||||
|
||||
|
||||
If after trying this, you still see the same problems, then, please `file an issue`_.
|
||||
If after trying this, you still see the same problems, then, please `fill an issue`_.
|
||||
|
||||
|
||||
|
||||
.. _`Salt`: http://saltstack.org/
|
||||
.. _`file an issue`: https://github.com/saltstack/salt-bootstrap/issues/new
|
||||
|
||||
|
||||
Unsupported Distro
|
||||
------------------
|
||||
|
||||
You found a Linux distribution which we still do not support or we do not correctly identify?
|
||||
Please run the following commands and report their output when creating a ticket:
|
||||
|
||||
.. code:: console
|
||||
|
||||
sudo find /etc/ -name '*-release' -print -exec cat {} \;
|
||||
command lsb_release -a
|
||||
.. _`fill an issue`: https://github.com/saltstack/salt-bootstrap/issues/new
|
||||
|
||||
|
||||
Testing in Vagrant
|
||||
------------------
|
||||
You can use Vagrant_ to easily test changes on a clean machine. The ``Vagrantfile`` defaults to an
|
||||
==================
|
||||
|
||||
You can use Vagrant_ to easily test changes on a clean machine. The ``Vagrantfile`` defaults to an
|
||||
Ubuntu box. First, install Vagrant, then:
|
||||
|
||||
.. code:: console
|
||||
|
||||
$ vagrant up
|
||||
$ vagrant ssh
|
||||
vagrant up
|
||||
vagrant ssh
|
||||
|
||||
|
||||
.. _Vagrant: http://www.vagrantup.com
|
||||
.. _Installing via an Insecure One-Liner: #installing-via-an-insecure-one-liner
|
||||
|
||||
|
||||
.. vim: fenc=utf-8 spell spl=en cc=100 tw=99 fo=want sts=2 sw=2 et
|
||||
|
|
|
@ -295,8 +295,10 @@ __usage() {
|
|||
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. Default: \${BS_FALSE}
|
||||
-H Use the specified http proxy for the installation
|
||||
touching /tmp/disable_salt_checks on the target host.
|
||||
Default: \${BS_FALSE}
|
||||
-H Use the specified HTTP proxy for all download URLs (including https://).
|
||||
For example: http://myproxy.example.com:3128
|
||||
-Z Enable additional package repository for newer ZeroMQ
|
||||
(Only available for RHEL/CentOS/Fedora/Ubuntu based distributions)
|
||||
-b Assume that dependencies are already installed and software sources are
|
||||
|
@ -872,7 +874,7 @@ __gather_linux_system_info() {
|
|||
[ "${rv}" != "" ] && v=$(__parse_version_string "$rv") || v=""
|
||||
case $(echo "${nn}" | tr '[:upper:]' '[:lower:]') in
|
||||
amzn )
|
||||
# Amazon AMI's after 2014.9 match here
|
||||
# Amazon AMI's after 2014.09 match here
|
||||
n="Amazon Linux AMI"
|
||||
;;
|
||||
arch )
|
||||
|
@ -907,7 +909,7 @@ __gather_linux_system_info() {
|
|||
#----------------------------------------------------------------------------------------------------------------------
|
||||
__gather_sunos_system_info() {
|
||||
if [ -f /sbin/uname ]; then
|
||||
DISTRO_VERSION=$(/sbin/uname -X | awk '/[kK][eE][rR][nN][eE][lL][iI][dD]/ { print $3}')
|
||||
DISTRO_VERSION=$(/sbin/uname -X | awk '/[kK][eE][rR][nN][eE][lL][iI][dD]/ { print $3 }')
|
||||
fi
|
||||
|
||||
DISTRO_NAME=""
|
||||
|
@ -3762,6 +3764,9 @@ install_scientific_linux_check_services() {
|
|||
# Amazon Linux AMI Install Functions
|
||||
#
|
||||
|
||||
# FIXME: 2010.xx releases are no longer avaliable: https://aws.amazon.com/amazon-linux-ami/
|
||||
# Need to add amazon case to __check_end_of_life_versions
|
||||
|
||||
install_amazon_linux_ami_2010_deps() {
|
||||
# Linux Amazon AMI 2010.xx seems to use EPEL5 but the system is based on CentOS6.
|
||||
# Supporting this would be quite troublesome and we need to workaround some serious package conflicts
|
||||
|
|
Loading…
Add table
Reference in a new issue