-
Notifications
You must be signed in to change notification settings - Fork 0
/
salt_master_minion_setup
119 lines (80 loc) · 2.22 KB
/
salt_master_minion_setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
pip installation :
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
/usr/local/bin/python2.7 get-pip.py
pip lastest version installation :
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
/usr/local/bin/python get-pip.py
pip install -U pip
Python3.9 installation
https://tecadmin.net/how-to-install-python-3-9-on-ubuntu-18-04/
sudo apt install wget build-essential checkinstall
sudo apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
cd /opt
sudo wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
tar xzf Python-3.9.0.tgz
cd Python-3.9.0
sudo ./configure --enable-optimizations
sudo make altinstall
apt install python3-pip
Install packages
apt-get install salt-api
apt-get install salt-cloud
apt-get install salt-master
apt-get install salt-minion
apt-get install salt-ssh
apt-get install salt-syndic
Steps to clean-up salt-master:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
/usr/local/bin/python get-pip.py
pip install -U pip
salt master setup:
pip install salt
apt-get update
apt-get install libssl-dev openssh-server python2.7-dev python-pip git python2.7
pip install git+https://github.com/Juniper/[email protected]
pip install setuptools -U
pip install junos-eznc jxmlease
pip install pyparsing twisted
pip install yamlordereddictloader
Salt proxy setup:
pip install junos-eznc jxmlease
on salt master:
cd /srv/pillar
update top.sls
base:
vmx1:
- vmx
update vmx.sls
proxy:
proxytype: junos
host: xx.xx.xx.xx
username: xyz
passwd: xyz
cd /etc/salt
cat proxy
master: 127.0.0.1
start the salt master
salt-master -l debug
start the salt-proxy
salt-proxy --proxyid=vmx1 -l debug
check salt-key
salt-key
Accepted Keys:
vmx1
Denied Keys:
Unaccepted Keys:
Rejected Keys:
Accept the salt-key
salt-keay -a vmx1
Run the salt commands :
salt "vmx1" junos.cli "show version"
salt "vmx1" junos.rpc "get-software-information"
salt "vmx1" junos.commit
salt "vmx1" junos.commit_check
salt "vmx1" junos.diff id=3
salt "vmx1" junos.facts
salt "vmx1" junos.facts_refresh
salt "vmx1" junos.ping <ip>
salt "vmx1" junos.rollback id=3
salt "vmx1" junos.set_hostname test1