20 February 2016

Salt: Install XenServer Minion

XenServer is based on CentOS

Enable Yum Repositories

NB: This may break your XenServer install

Salt requires yum-utils and gmp
The yum repos containing these are disabled by default
  1. List the installed repos:
    yum repolist all
  2. You'll need to enable the repository manually in the config file e.g.:
    1. Copy original:
      cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.orig
    2. Edit file:
      vi /etc/yum.repos.d/CentOS-Base.repo
    3. Initiate INSERT mode: i
    4. Make necessary changes in the first repo:
      Uncomment (remove #) from baseurl=http
      Replace centos/$releasever with the version e.g. centos/7.2.1511
  3. Update the repositories:
    yum update
  4. Install yum-utils:
    yum install yum-utils

Install Salt Minion

Add the SaltStack Repository


This is now much simpler: you can just run one command:
sudo yum install https://repo.saltstack.com/yum/redhat/salt-repo-latest-1.el7.noarch.rpm
Then install the required components e.g.

  1. Install the salt:
    wget https://repo.saltstack.com/yum/redhat/5/x86_64/latest/SALTSTACK-EL5-GPG-KEY.pub
    rpm --import SALTSTACK-EL5-GPG-KEY.pub
    rm -f SALTSTACK-EL5-GPG-KEY.pub
  2. Add the saltstatck repo:
    vi /etc/yum.repos.d/saltstack.repo
  3. Paste in the following (press 'i' first to enter INSERT mode):
    name=SaltStack repo for RHEL/CentOS $releasever

Edit the repository File

  1. Edit the above:
    vi /etc/yum.repos.d/salt-latest.repo
  2. Replace $releasever with '7'
  3. Clear the cache and update:
    yum clean expire-cache
    yum update

Install the salt-minion:

UPDATE: Error: Package: salt-2016.3.3-2.el7.noarch (salt-latest)
           Requires: systemd-python
See: https://bugs.xenserver.org/browse/XSO-620

systemd has the wrong package version, so we dont  have a suitable systemd-python RPM to match

So we need to install systemd-python without dependencies:
wget ftp://rpmfind.net/linux/centos/7.2.1511/os/x86_64/Packages/systemd-python-219-19.el7.x86_64.rpm
rpm -i --nodeps systemd-python-219-19.el7.x86_64.rpm

Finally you are ready to install the salt minion:
yum install salt-minion

Next you will need to configure the minion.

No comments:

Post a Comment