Skip to content
Amy Buck edited this page Apr 24, 2018 · 10 revisions

Salt

Salt (also referred to as SaltStack) is a Python-based open source configuration management software and remote execution agent. Salt supports the infrastructure as code approach to deployment and cloud management.

Salt has two main components:

  • The Salt master (server) is the location where users interact with all Salt minions (client); all Salt minions are subscribed to the Salt master.

  • The Salt minion (client) nodes are the minions (such as OPX devices) that are managed by the Salt master. The Salt minion is installed on each client (OPX device) and the Salt master IP is configured in the minion.

The Salt master acts as a hub for configuration data — the Salt master stores all modules, states, formulas, and templates. The Salt key describes each subscribed minion that is managed by the Salt master.

NOTE: See About SaltStack and SaltStack Documentation for complete information.

Dependencies

The Salt minion should be installed and run on the OpenSwitch OPX (client) device.

Salt setup and execution

Salt master installation

sudo add-apt-repository --remove ppa:saltstack/salt
        # if this fails run "sudo apt-get install -y software-properties-common"
apt-get install curl
curl -L https://bootstrap.saltstack.com -o install_salt.sh
sh install_salt.sh -P -M
        # if this fails kill all Salt processes "ps -ef | grep -i salt" and run the command again

mkdir -p /srv/{salt,pillar}
mkdir -p /srv/salt/{templates,states}

vi /etc/salt/master
        # Uncomment "interface 0.0.0.0"
        # add "pillar_roots" (intent is important as this is YAML structure)
    pillar_roots:
            base:
                - /srv/pillar
        # add "file_roots" (intent is important as this is YAML structure)
    file_roots:
            base:
                - /srv/salt
                    - /srv/pillar
                - /srv/salt/templates
                - /srv/salt/states

service salt-master restart
service salt-master status

Salt minion installation on OPX device

apt-get install curl
curl -L https://bootstrap.saltstack.com -o install_salt.sh
sh install_salt.sh -P

vi /etc/salt/minion
    master: <salt master-ip>

service salt-minion restart
service salt-minion status

Configure key in Salt master

salt-key -A
        # This command will ask Y/N - enter Y and include the OPX box name in the output of this command
salt-key -L
        # The OPX box name should be present in the output of this command

NOTE: See Key Management for more information.

Verify Salt minion started successfully in OPX device

service salt-minion restart
service salt-minion status

Sample OPX Salt states

Clone this wiki locally