Ubuntu 18.04 comes with Python 3.6.8 installed by default.
After downloading the .zip or cloning the repo, the remainder of the commands should reference the files inside the path where you extracted the files.
wget -O - https://repo.saltstack.com/apt/debian/9/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
touch /etc/apt/sources.list.d/saltstack.list
Set deb http://repo.saltstack.com/apt/debian/9/amd64/latest stretch main
as the contents of /etc/apt/sources.list.d/saltstack.list
These steps were based on those from SaltStack directly: https://repo.saltstack.com/#debian
The version of salt-minion in the Ubuntu 18.04 distribution is quite old (2017.7.4) and needs to be updated to a more recent version. This adds the new feed to the aptitude package manager and installs the public key for that repo. We define the URL to the repo in the saltstack.list. This URL pins the verion to the latest repo, but it could be modified to point to a specific version if needed. See the SaltStack documentation for more information.
suddo apt-get update
This ensures we're installing the latest packages from the feeds.
sudo apt-get install python3-pip
This will be used in the next step to install the SystemLink python SDK
pip3 install ./systemlink_sdk-19.5.0-py3-none-any.whl
This automatically installs the python libraries for communicating with the SystemLink server. Pip3 will auto-detect the currently active version of python and install the python modules into the correct directories to be detected and imported by your code.
sudo apt-get install salt-minion
At the time of creation, this installs the latest salt-minion (2019.2.0 Flourine).
/etc/init.d/salt-minion stop
Stop the salt minion service so that python libraries and configuration files can be modified without having it try to connect during modification.
mkdir /var/lib/salt
mkdir /var/lib/salt/minion
mkdir /var/lib/salt/minion/extmods
cp -r ./var/lib/salt/minion/extmods/* /var/lib/salt/minion/extmods/
This contains SystemLink specific modules, grains, and beacons that customize how the salt-minion behaves.
Edit /etc/salt/minion_id
and set the identifier that you want to show up in SystemLink's Systems Management UI. This should be a unique value that avoids special characters. Use hyphens instead of underscores.
Edit /etc/salt/minion.d/master.conf
to point to your SystemLink server. This can be a fully-qualified domain name, hostname, or IP address as long as that resolves on your network.
cp ./etc/salt/minion.d/systemlink.conf /etc/salt/minion.d/
This configuration file sets some default behavior of the minion modules and specific file paths where to put / find files.
rm -rf /var/lib/salt/pki/minion/minion_master.pub
The master's public key will be wrong if you've ever connected to a different salt-master before. Since it may automatically try to connect to a server when the salt-minion starts after installation, you may need to delete this to prevent mismatched master keys. It will obtain a new key from the master when it connects the next time.
/etc/init.d/salt-minion restart
Now that we've customized the salt-minion modules, we need to restart the service for them to take effect.
The minion's security key now needs to be approved by the SystemLink server to allow the minion to connect. Modify the URL below to point to the SystemLink Server instead of localhost:
http://localhost/#systemsmanagement/unapproved
Verify the key is correct and click the 'Approve' button next to the minion you want to allow to connect.
Verify that /etc/natinst/niskyline/HttpConfigurations/http_master.json
exists. If the minion has successfully connected to the master, it will have automatically and securely transferred the HTTP connection information (including a generated API key) to the minion which the python SDK will use to connect.
There will still be errors in the salt minion log about 'NoneType for grains is not subscriptable'. This is OK.