@@ -12,6 +12,7 @@ if [[ $(/usr/bin/id -u) != "0" ]]; then
12
12
exit
13
13
fi
14
14
15
+ # Check if user-input exists
15
16
if [ " 1ドル " != " " ]; then
16
17
new_hostname=1ドル
17
18
else
21
22
22
23
MASTERIP=1ドル
23
24
25
+ # Function to install salt-minion
24
26
install_minion () {
27
+
28
+ # Get the saltstack key and create the salt repo
25
29
wget -O - https://repo.saltstack.com/apt/debian/8/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add -
26
30
echo -e " deb http://repo.saltstack.com/apt/debian/8/amd64/latest jessie main" >> /etc/apt/sources.list.d/saltstack.list
31
+
27
32
apt-get update
33
+
34
+ # Install salt-minion and firewalld
28
35
apt-get install salt-minion salt-ssh firewalld -y
29
36
37
+ # Open the Salt-minon port
30
38
firewall-cmd --zone=public --add-port=4506/tcp --permanent
31
39
firewall-cmd --reload
32
40
41
+ # Add the Salt-Master's IP to the minion's config file
33
42
sed -i " s/\#master:\ salt/master:\ $MASTERIP /g" /etc/salt/minion
34
43
44
+ # Enable and start the minion service
35
45
systemctl enable salt-minion
36
46
systemctl start salt-minion
37
47
}
38
48
49
+ # Calls the install_minion function
39
50
install_minion
0 commit comments