Salt Minion

This is more of a guide on how to install saltstack on distributions of linux that run Python3.13 There’s certain modules that saltstack uses that have been removed from Python3.13, such as spwd for handling password for user accounts

Install relenv

Relenv is very similar to pyenv, but instead of using the system python, it will use a custom version of Python

First we’lll make a virtual environment to install relenv in

python3 -m venv /opt/relenv

Install relenv

cd /opt/relenv/bin
./pip3 install --upgrade pip
./pip3 install relenv

Use the newly installed relenv to build the new virtual environment with the custom Python version

./relenv fetch --python 3.10.17
./relenv create --python 3.10.17 /opt/salt

Install salt

Go to the new venv and install salt & dependencies

cd /opt/salt/bin
./pip3 install --upgrade pip
./pip3 install salt aiohappyeyeballs aiosignal cheroot contourpy cycler distro \
  fonttools frozenlist kiwisolver looseversion matplotlib multidict numpy \
  pandas pillow pooch portend propcache pyparsing pyyaml scipy six tempora \
  yarl zc.lockfile zipp aiohttp cherrypy croniter python-dateutil python-gnupg \
  importlib-metadata jinja2 jmespath markupsafe msgpack networkx pycryptodomex \
  pyzmq systemd tornado

Make symlinks so salt is available in the system path

ln -s /opt/salt/bin/salt-call /usr/bin/salt-call
ln -s /opt/salt/bin/salt-minion /usr/bin/salt-minion

Let’s get the basic configuration files installed

mkdir -p /etc/salt/minion.d
echo $(hostname) > /etc/salt/minion_id

Create a systemd service unit file

cat << EOF > /etc/systemd/system/salt-minion.service
[Unit]
Description=The Salt minion
After=network.target salt-master.service

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

[Install]
WantedBy=multi-user.target
EOF

Reload systemd so it picks up on the configuration changes

systemctl daemon-reload

Enable and start the salt-minion

systemctl enable salt-minion --now

Monitor the salt-minion logs to make sure everything is copacetic

journalctl -u salt-minion -f