-
Notifications
You must be signed in to change notification settings - Fork 56
Building SaltStack
Below versions of SaltStack(Salt) are available in respective distributions at the time of creation of these build instructions:
- RHEL (9.2, 9.4, 9.5) have
3005.4
- SLES 15 SP6 has
3006.0
- Ubuntu 22.04 has
3004.1
The instructions provided below specify the steps to build SaltStack(Salt) v3007.1 on Linux on IBM Z for the following distributions:
- RHEL (8.8, 8.10, 9.2, 9.4, 9.5)
- SLES 15 SP6
- Ubuntu (20.04, 22.04, 24.04, 24.10)
General notes:
- When following the steps below please use a standard permission user unless otherwise specified.
- A directory
/<source_root>/
will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.
If you want to build Salt using manual steps, go to STEP 2.
Use the following commands to build Salt using the build script. Please make sure you have wget installed.
wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/SaltStack/3007.1/build_salt.sh
# Build Salt
bash build_salt.sh [Provide -t for executing build with tests]
If the build completes successfully, go to STEP 5 to configure salt. In case of error, check logs
for more details or go to STEP 2 to follow manual build steps.
export SOURCE_ROOT=/<source_root>/
export PATCH_URL="https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/SaltStack/3007.1/patch/"
-
RHEL (8.8, 8.10)
sudo yum install -y procps-ng zeromq-devel cyrus-sasl-devel gcc gcc-c++ git libffi-devel libtool libxml2-devel libxslt-devel make man swig tar wget cmake bzip2-devel gdbm-devel libdb-devel libnsl2-devel libuuid-devel ncurses-devel openssl openssl-devel readline-devel sqlite-devel tk-devel xz xz-devel zlib-devel glibc-langpack-en diffutils
-
RHEL (9.2, 9.4, 9.5)
sudo yum install -y procps-ng zeromq-devel cyrus-sasl-devel gcc gcc-c++ git libffi-devel libtool libxml2-devel libxslt-devel make man openssl-devel swig tar wget cmake python3-devel python3-pip bzip2-devel sqlite-devel
-
SLES 15 SP6
sudo zypper install -y curl cyrus-sasl-devel gawk gcc gcc-c++ git libopenssl-devel libxml2-devel libxslt-devel make man tar wget cmake libnghttp2-devel gdbm-devel libbz2-devel libdb-4_8-devel libffi-devel libuuid-devel ncurses-devel readline-devel sqlite3-devel tk-devel xz-devel zlib-devel gzip bzip2
-
Ubuntu 20.04
sudo apt-get update sudo apt-get install -y wget g++ gcc git libffi-dev libsasl2-dev libssl-dev libxml2-dev libxslt1-dev libzmq3-dev make man python3-dev python3-pip tar libz-dev pkg-config apt-utils curl cmake libbz2-dev libsqlite3-dev
-
Ubuntu (22.04, 24.04, 24.10)
sudo apt-get update sudo apt-get install -y wget g++ gcc git libffi-dev libsasl2-dev libssl-dev libxml2-dev libxslt1-dev libzmq3-dev make man tar libz-dev pkg-config apt-utils curl cmake libbz2-dev libdb-dev libgdbm-dev liblzma-dev libncurses-dev libreadline-dev libsqlite3-dev tk-dev uuid-dev xz-utils zlib1g-dev
-
Install
Python 3.10.12
cd $SOURCE_ROOT wget https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tgz tar -xzf Python-3.10.12.tgz cd Python-3.10.12 ./configure --prefix=/usr/local --exec-prefix=/usr/local --enable-loadable-sqlite-extensions make sudo make install export PATH=/usr/local/bin/python3.10:$PATH python3 -V
-
Install M2Crypto (RHEL only)
pip3 install M2Crypto
-
Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y source $HOME/.cargo/env rustup default 1.78.0
-
Install Libgit2
cd $SOURCE_ROOT wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.7.0.tar.gz tar xzf v1.7.0.tar.gz cd libgit2-1.7.0/ cmake . make sudo make install
-
Install Python packages-
pip3 install pyzmq 'PyYAML<5.1' pycrypto msgpack-python jinja2 psutil futures tornado python-dateutil genshi looseversion packaging distro #For RHEL and SLES Only pip3 install pyzmq 'PyYAML<5.1' pycrypto msgpack-python jinja2 psutil futures==2.2.0 tornado python-dateutil genshi looseversion packaging distro #For Ubuntu Only
cd $SOURCE_ROOT
git clone --depth 1 -b v3007.1 https://github.com/saltstack/salt.git
cd salt
curl -sSL $PATCH_URL/salt.patch | git apply -
pip3 install -e .
cd $SOURCE_ROOT/salt
pip3 install nox
python3 -m nox -e "test-3(coverage=False)" -- --core-tests --slow-tests
Note: There are around 40 test failures observed on all distros on Intel and Z.
- Edit
$SOURCE_ROOT/salt/master
and$SOURCE_ROOT/salt/minion
:
currentuser="$(whoami)"
sed -i "s/#user: root/user: $currentuser/" conf/master
sed -i 's,#root_dir: /,'"root_dir: $SOURCE_ROOT"',' conf/master
sed -i 's/#publish_port: 4505/publish_port: 4505/' conf/master
sed -i 's/#ret_port: 4506/ret_port: 4506/' conf/master
sed -i 's/#master: salt/master: localhost/' conf/minion
sed -i "s/#user: root/user: $currentuser/" conf/minion
sed -i 's,#root_dir: /,'"root_dir: $SOURCE_ROOT"',' conf/minion
sed -i 's/#master_port: 4506/master_port: 4506/' conf/minion
sed -i 's/#id:/id: saltdev/' conf/minion
Note: If the ret_port value in the master config file is changed, set the same value to master_port value in the minion config file
- Now you can start your Salt master and minion, specifying the config dir.:
salt-master --config-dir=$SOURCE_ROOT/salt/conf --log-level=debug --daemon salt-minion --config-dir=$SOURCE_ROOT/salt/conf --log-level=debug --daemon
Note: If above command throws error salt-master: command not found
then set PATH as export PATH=$SOURCE_ROOT/.local/bin:$PATH
install -y salt-master salt-minion salt-ssh salt-syndic salt-cloud salt-api
- Now you should be able to accept the minion key:
salt-key -c $SOURCE_ROOT/salt/conf -Ay
- Check that your master/minion are communicating:
salt -c $SOURCE_ROOT/salt/conf \* test.version
The information provided in this article is accurate at the time of writing, but on-going development in the open-source projects involved may make the information incorrect or obsolete. Please open issue or contact us on IBM Z Community if you have any questions or feedback.