20 February 2016

Salt: Install XenServer Minion


XenServer is based on CentOS

Prerequisits
Install yum-utils. To do this you'll need to enable yum repos.
Salt requires yum-utils and gmp

Install Salt Minion

Add the SaltStack Repository

UPDATE

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):
    [saltstack-repo]
    name=SaltStack repo for RHEL/CentOS $releasever
    baseurl=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
    enabled=1
    gpgcheck=1
    gpgkey=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-EL5-GPG-KEY.pub

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.

4 comments:

  1. Have you figured out how to get salt to manage your services on XenServer 7? Mine will only manage the sysvinit services. I've tried:

    1. install systemd-python as you described (--nodeps)

    2. build systemd-python from CentOS using the same version but adjusting the revision to match Xen's (to avoid --nodeps)

    3. Retreived Xen's source RPM for systemd and build systemd-python from that.

    Salt installs and most things work, just not managing services.

    ReplyDelete
  2. I previously asked if you were able to manage services with salt, after I wiped my system and repeated my stps, it's working fine, using a systemd-python build from xen's systemd source package.

    ReplyDelete
  3. Like you I got it to run, but not to do anything. Thanks for the tip on using xen sources.

    ReplyDelete
    Replies
    1. You should just be able to do something like this, to make sure ntpd is running, and will come up on boot.

      ntpd:
      service.running:
      - enable: True

      Change ntpd to sshd, etc. for other services.

      Delete