Saltstack install: Difference between revisions

From wikinotes
 
Line 32: Line 32:
= platforms =
= platforms =
<blockquote>
<blockquote>
== Virtualenv ==
<blockquote>
Saltstack is written in python, an interpreted language.<br>
Most package managers do not isolate installed programs, leading to requirement conflicts.<br>
There is value in installing saltstack into a virtualenv, so that your userland and saltstack do not conflict with each other.<br>
Downsides include taking responsibility for updates. Please make certain to do so!
<syntaxhighlight lang="bash">
sudo -i
virtualenv services/saltstack
cd services/saltstack
bin/pip install salt
</syntaxhighlight>
=== systemd ===
<blockquote>
<syntaxhighlight lang="systemd">
# /etc/systemd/system/virtualenv-salt-minion.service
[Unit]
Description=Salt-Minion
[Service]
KillMode=process
Type=notify
NotifyAccess=all
LimitNOFILE=8192
ExecStart=/root/services/saltstack/bin/salt-minion
[Install]
WantedBy=multi-user.target
</syntaxhighlight>
You'll also want to install symlinks for salt's various executables.
<syntaxhighlight lang="bash">
for exe in salt-api salt salt-api salt-call salt-cloud salt-cp salt-key salt-run salt-ssh salt-syncdic salt-unity; do
    ln -s /root/services/saltstack/bin/${exe} /usr/bin/${exe}
done
</syntaxhighlight>
</blockquote><!-- systemd -->
=== FreeBSD-init ===
<blockquote>
TODO
</blockquote><!-- FreeBSD-init -->
</blockquote><!-- Virtualenv -->
== FreeBSD ==
== FreeBSD ==
<source lang="bash">
<source lang="bash">

Revision as of 20:53, 12 March 2022

General

Installation Type

Salt has very flexible installation options. Before you install, you should decide how you'd like to use salt.

  • salt-master/salt-minion:
    • salt-master: hosted on central server. keeps the statefiles, pillar, and manages encryption/decryption of pillar.
    • salt-minion: hosted on each salt-managed server. Receives/Applies instructions from salt-master.
  • serverless
    • states/pillar stored locally, and states are applied with argument --local.

Installer Options

If you are installing on a unix system, you can install salt either by using the version of salt in your distrobution's package repository or using salt's bootstrap script.

Bootstrap script Install

curl -L https://bootstrap.saltstack.com -o /tmp/install_salt.sh
sudo sh /tmp/install_salt.sh -M
rm      /tmp/install_salt.sh

platforms

Virtualenv

Saltstack is written in python, an interpreted language.
Most package managers do not isolate installed programs, leading to requirement conflicts.
There is value in installing saltstack into a virtualenv, so that your userland and saltstack do not conflict with each other.
Downsides include taking responsibility for updates. Please make certain to do so!

sudo -i
virtualenv services/saltstack
cd services/saltstack
bin/pip install salt

systemd

# /etc/systemd/system/virtualenv-salt-minion.service

[Unit]
Description=Salt-Minion

[Service]
KillMode=process
Type=notify
NotifyAccess=all
LimitNOFILE=8192
ExecStart=/root/services/saltstack/bin/salt-minion

[Install]
WantedBy=multi-user.target

You'll also want to install symlinks for salt's various executables.

for exe in salt-api salt salt-api salt-call salt-cloud salt-cp salt-key salt-run salt-ssh salt-syncdic salt-unity; do
    ln -s /root/services/saltstack/bin/${exe} /usr/bin/${exe}
done

FreeBSD-init

TODO

FreeBSD

pkg instsall py37-salt

# if unable to master over localhost, likely a silent permissions issue
find /var/log/salt -exec chown salt:salt {} \;
find /usr/local/etc/salt -exec chown salt:salt {} \;

Archlinux

sudo pacman -S salt

Ubuntu/Debian

CentOS

Windows

Diable UAC
choco install saltminion

MacOS

macports

sudo port install salt-minion
sudo port install py27-crypto
sudo port install py27-requests

# enable service
sudo port load salt-minion

brew

brew install saltstack