Configuring SaltStack on Cumulus Linux

Follow

SaltStack is an automation and orchestration product. It relies on an agent called the Salt Minion running on the Cumulus Linux switch to communicate with a central server, called the Salt Master. SaltStack allows for the switch to pull configurations from the Salt Master (similar to Puppet) or to push configurations from the Salt Master (similar to Ansible). The Salt Master would be a server in the data center management network used to manage all of the Salt Minions.

Note: Since Cumulus Linux is a Debian Linux distribution, you install the SaltStack agent on a Cumulus Linux switch the same way you install Salt on Debian Linux. 

Salt provides a multi-platform bootstrap script to simplify the install. At this time the bootstrap does not properly recognize Cumulus Linux. A pull request has been submitted to resolve this.

Installing Salt on Cumulus Linux 3.x

Cumulus Linux 3.x is based on Debian Jessie. The instructions below follow the Salt instructions for Debian Jessie. 

Note: These instructions assume x86. For ARM-based platforms, replace "amd64" with "armhf" in the Salt repository lines.

  1. Edit /etc/apt/sources.list and add the Debian and Salt repositories:
    cumulus@switch$ sudo sh -c 'echo "deb http://ftp.us.debian.org/debian/ jessie main contrib non-free" >> /etc/apt/sources.list'

    cumulus@switch$ sudo sh -c 'echo "deb http://repo.saltstack.com/apt/debian/8/amd64/latest jessie main" >> /etc/apt/sources.list'
  2. Add the Salt repository key to apt:
    wget -O - https://repo.saltstack.com/apt/debian/8/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
  3. Update the apt cache:
    cumulus@switch$ sudo apt-get update
  4. Install the Salt Minion on the Cumulus Linux device:
    cumulus@switch$ sudo apt-get install salt-minion

Installing Salt on Cumulus Linux 2.5 Extended Support Release

Cumulus Linux 2.5 is based on Debian Wheezy. The instructions below follow the Salt instructions for Debian Wheezy.

  1. Edit /etc/apt/sources.list and add the Debian and Salt repositories:
    cumulus@switch$ sudo sh -c 'echo "deb http://ftp.us.debian.org/debian/ wheezy main contrib non-free" >> /etc/apt/sources.list'

    cumulus@switch$ sudo sh -c 'echo "deb http://debian.saltstack.com/debian wheezy-saltstack main" >> /etc/apt/sources.list'
  2. Add the Salt repository key to apt:
    cumulus@switch$ wget -q -O- "http://debian.saltstack.com/debian-salt-team-joehealy.gpg.key" | sudo apt-key add -
  3. Update the apt cache:
    cumulus@switch$ sudo apt-get update
  4. Install the Salt Minion on the Cumulus Linux device:
    cumulus@switch$ sudo apt-get install salt-minion

Configuring Salt Minion and Salt Master

The following configuration applies for both Cumulus Linux 2.5 and Cumulus Linux 3.x

  1. Edit the Salt Minion configuration to point to the Salt Master.
    Note: If DNS resolves "salt" to the Salt Master, you can skip this step. This example assumes the Salt Master is at 10.0.0.1:
    cumulus@switch$ sudo sed -i 's/#master: salt/master:10.0.0.1/g' /etc/salt/minion
  2. Restart the Salt Minion:
    For Cumulus Linux 2.5
    cumulus@switch$ sudo service salt-minion restart
    For Cumulus Linux 3.x
    cumulus@switch$ sudo systemctl restart salt-minion.service
  3. View the Salt Minion's key on the Salt Master.
    Note: The Salt Master is not on the Cumulus Linux switch, but the server running Salt Master.
    user@salt-master$ sudo salt-key -L
    Accepted Keys:
    Denied Keys:
    Unaccepted Keys:
    salt-minion
    Rejected Keys:
  4. Accept the Cumulus Salt Minion key on the Salt Master:
    user@salt-master$ sudo salt-key -a salt-minion
    The following keys are going to be accepted:
    Unaccepted Keys:
    salt-minion
    Proceed? [n/Y] Y
    Key for minion salt-minion accepted.
  5. Test connectivity from the Salt Master:
    user@salt-master$ salt '*' test.ping
    salt-minion:
    True
Have more questions? Submit a request

Comments

Powered by Zendesk