|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +##################################################### |
| 4 | +# # |
| 5 | +# A shell script to install Salt-Minion on Debian # |
| 6 | +# # |
| 7 | +##################################################### |
| 8 | + |
| 9 | +# check if the current user is root |
| 10 | +if [[ $(/usr/bin/id -u) != "0" ]]; then |
| 11 | + echo -e "This looks like a 'non-root' user.\nPlease switch to 'root' and run the script again." |
| 12 | + exit |
| 13 | +fi |
| 14 | + |
| 15 | +MASTERIP=1ドル |
| 16 | + |
| 17 | +install_minion() { |
| 18 | + wget -O - https://repo.saltstack.com/apt/debian/8/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add - |
| 19 | + echo -e "deb http://repo.saltstack.com/apt/debian/8/amd64/latest jessie main" >> /etc/apt/sources.list.d/saltstack.list |
| 20 | + apt-get update |
| 21 | + apt-get install salt-minion salt-ssh firewalld -y |
| 22 | + |
| 23 | + firewall-cmd --zone=public --add-port=4506/tcp --permanent |
| 24 | + firewall-cmd --reload |
| 25 | + |
| 26 | + sed -i "s/\#master:\ salt/master:\ $MASTERIP/g" /etc/salt/minion |
| 27 | + |
| 28 | + systemctl enable salt-minion |
| 29 | + systemctl start salt-minion |
| 30 | +} |
0 commit comments