Abschnitt: Installation
Quelle: https://repo.saltstack.com/#debian
Ausführen als Superuser (root)
Code: Select all
echo 'deb http://repo.saltstack.com/apt/debian/9/amd64/latest stretch main' >> /etc/apt/sources.list.d/saltstack.list
Code: Select all
wget -O - https://repo.saltstack.com/apt/debian/9/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
deb http://repo.saltstack.com/apt/debian/9/amd64/latest stretch main
Abschnitt: Master Konfiguration
Code: Select all
apt-get update
apt-get install salt-master salt-minion salt-ssh
Code: Select all
salt-key -F master
Inhalt der /etc/salt/master editieren (IP Anpassen)Local Keys:
master.pen: 4e:2c:0a:1f:41:51:a2:4f:2e:1a:ff:d1:2d:4e:2c:0a:1f:41:51:a2:4f:2e:1a:ff:d1:2d:1a:ff:d1:2d:1a:ff
master.pub: d1:2d:4e:2c:0a:1f:41:51:a2:4f:2e:d1:2d:4e:2c:0a:1f:41:51:a2:4f:2e:d1:2d:4e:2c:0a:1f:41:51:a2:4f
Code: Select all
interface: 192.168.0.1
ping_on_rotate: True
file_roots:
base:
- /srv/salt/salt
pillar_roots:
base:
- /srv/salt/pillar
hash_type: sha256
Ab hier nur, wen der Master sich selbst verwalten soll!
Um sich als Master selbst verwalten zu können, muss der Master auch als Minion behandelt werden.
Konfiguration des Master als Minion durch editieren der /etc/salt/minion <= Master PUB Key einfügen
Code: Select all
master_finger: 'd1:2d:4e:2c:0a:1f:41:51:a2:4f:2e:d1:2d:4e:2c:0a:1f:41:51:a2:4f:2e:d1:2d:4e:2c:0a:1f:41:51:a2:4f'
hash_type: sha256
master: salt
Code: Select all
127.0.0.1 salt
Servername1:
host: 192.168.0.101 # The IP addr or DNS hostname
user: sshbenutzer # Remote executions will be executed as user fred
passwd: fiesespasswd # The password to use for login, if omitted, keys are used
sudo: True # Whether to sudo to root, not enabled by default
Servername2:
host: 192.168.0.102
...
Salt Minion installation via salt-ssh
Quelle: https://bencane.com/2016/07/19/using-sa ... tall-salt/
Master RSA SSH Key auf potentiellen Minion kopieren
Code: Select all
ssh-copy-id -i /etc/salt/pki/master/ssh/salt-ssh.rsa.pub sshbenutzer@192.168.0.101
https://youtu.be/F3WZKhKKhz0