Skip to content
Sebastian Schmidt edited this page Nov 6, 2021 · 11 revisions

Salt Master

This package is used to send commands and configurations to the Salt minion that is running on managed systems.

Caveats

Salt master is running as non-root: https://docs.saltproject.io/en/latest/ref/configuration/nonroot.html

Salt Minion

This package runs the Salt minion which receives commands and configuration from a Salt master.

Configuration Files

Salt Master: /var/packages/salt-master/etc/salt

Salt Minion: /var/packages/salt-minion/etc/salt

Running salt commands

$ sudo su sc-salt-master -s /usr/bin/bash
$ salt -c /var/packages/salt-master/etc/salt '*' cmd.run 'ls -l'

Example

  1. Install both salt-minion and salt-master

  2. Add salt-minion to salt-master (via ssh):

$ sudo su sc-salt-master -s /usr/bin/bash
$ salt-key -c /var/packages/salt-master/etc/salt --list all
$ salt-key -c /var/packages/salt-master/etc/salt -a dsm6
# Test and run commands:
$ salt -c /var/packages/salt-master/etc/salt '*' test.ping
$ salt -c /var/packages/salt-master/etc/salt '*' cmd.run 'ls -l'

Troubleshooting

Authentication error occurred.

  • Make sure that you are running commands as the salt-master user: sudo su sc-salt-master -s /usr/bin/bash
Clone this wiki locally