Skip to content

Building SaltStack

aborkar-ibm edited this page Apr 17, 2019 · 43 revisions

Building SaltStack

Below versions of SaltStack(Salt) are available in respective distributions at the time of creation of these build instructions:

  • SLES 15 has 2018.3.0
  • Ubuntu 16.04 has 2015.8.8
  • Ubuntu 18.04 has 2017.7.4

The instructions provided below specify the steps to build SaltStack v2019.2.0 on Linux on IBM Z for the following distributions:

  • RHEL (6.10, 7.4, 7.5, 7.6)
  • SLES (12 SP4, 15)
  • Ubuntu (16.04, 18.04)

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.

Step 1: Install the dependencies

export SOURCE_ROOT=/<source_root>/
  • RHEL (6.10, 7.4, 7.5, 7.6)

    sudo yum install -y cyrus-sasl-devel gcc gcc-c++ git libffi-devel libtool libxml2-devel libxslt-devel make man openssl-devel swig tar wget
    
    • Install Python 3.x -- Instructions for building Python 3.x can be found here.

    • Install M2Crypto

      sudo -H pip3 install M2Crypto
      
    • Install ZeroMQ

      cd $SOURCE_ROOT
      wget https://github.com/zeromq/zeromq4-1/releases/download/v4.1.6/zeromq-4.1.6.tar.gz
      tar -xzvf zeromq-4.1.6.tar.gz
      cd zeromq-4.1.6
      ./configure
      make
      sudo make install
      sudo ldconfig
      
  • SLES (12 SP4, 15)

    sudo zypper install -y curl cyrus-sasl-devel gawk gcc gcc-c++ git libffi-devel libopenssl-devel libxml2-devel libxslt-devel make man python3-devel tar wget zeromq-devel
    • Install pip

      curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
      sudo python3 get-pip.py
      
  • Ubuntu (16.04, 18.04)

    sudo apt-get update
    sudo apt-get install -y g++ gcc git libffi-dev libsasl2-dev libssl-dev libxml2-dev libxslt1-dev libzmq3-dev make man python3-dev python3-pip tar wget

Step 2: Clone the repository and install SaltStack

cd $SOURCE_ROOT
git clone git://github.com/saltstack/salt
cd salt
git checkout v2019.2.0
sudo -H pip3 install pyzmq 'PyYAML<5.1' pycrypto msgpack-python jinja2 psutil futures tornado
sudo -H pip3 install -e .

Step 3: Configure SaltStack to run self-contained version

cd $SOURCE_ROOT
mkdir -p $SOURCE_ROOT/etc/salt/pki/{master,minion}
cp ./salt/conf/master ./salt/conf/minion $SOURCE_ROOT/etc/salt/
  • Edit config file $SOURCE_ROOT/etc/salt/master as shown below

    -	    #user: root
    +	    user: <username>
    -	    #root_dir: /
    +	    root_dir: /<source_root>/

    Note: Change the publish_port and ret_port values if required

  • Edit config file $SOURCE_ROOT/etc/salt/minion as shown below

    -	    #master: salt
    +	    master: localhost
    -	    #user: root
    +	    user: <username>
    -	    #root_dir: /
    +	    root_dir: /<source_root>/

    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

  • Start the master and minion, accept the minion's key, and verify your local Salt installation is working:

    cd $SOURCE_ROOT
    salt-master -c ./etc/salt -d
    salt-minion -c ./etc/salt -d
    salt-key -c ./etc/salt -L
    salt-key -c ./etc/salt -A
    salt -c ./etc/salt '*' test.version

Step 4: Test SaltStack (Optional)

cd $SOURCE_ROOT/salt
wget -O requirements/tests.txt https://raw.githubusercontent.com/saltstack/salt/hotfix/pytest/requirements/tests.txt
wget -O requirements/pytest.txt https://raw.githubusercontent.com/saltstack/salt/hotfix/pytest/requirements/pytest.txt
sudo -H pip3 install jsonschema==2.6.0
sudo -H pip3 install -r requirements/tests.txt
sudo python3 tests/runtests.py

Note: User can ignore intermittent test-case failures as it does not affect the functionality. Test failures seen in the following modules can be ignored as those are not related to IBM Z Systems: Module Tests, Shell Tests and Unit Tests.

References:

https://docs.saltstack.com/en/latest/topics/installation/index.html
https://docs.saltstack.com/en/latest/topics/development/hacking.html
https://docs.saltstack.com/en/latest/topics/development/tests/index.html

Clone this wiki locally