-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bash_history
327 lines (327 loc) · 9.44 KB
/
.bash_history
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
exit
lab install setup
yum list installed python
sudo yum install -y ansible
ssh servera.lab.example.com
mkdir dep-install
pwd
cd /home/student/
mkdir dep-install
cd dep-install/
vim inventory
ansible dev -i inventory --list
ansible dev -i inventory --list-hosts
lab install grade
lab manage setup
cd ..
mkdir dep-manage
cd dep-manage/
vim ansible.cfg
vim inventory
ansible myself -i inventory --list
vim inventory
ansible myself -i inventory --list
vim ansible.cfg
ansible intranetweb -i inventory --list -v
vim ansible.cfg
lab manage grade
lab adhoc setup
sudo cat /etc/sudoers.d/devops
pwd
cd ..
mkdir dep-adhoc
cd dep-adhoc/
cat ansible.cfg
cat inventory
ansible localhost -m command -a 'id'
ansible localhost -m shell -a 'id'
ansible localhost -m command -a 'id' -u devops
ansible localhost -m command -a 'id' -u root
ansible localhost -m command -a 'cat /etc/motd' -u devops
ansible localhost -m copy -a 'content="Managed by Ansible\n" dest=/etc/motd' -u devops
ansible localhost -m copy -a 'content="Managed by Ansible\n" dest=/etc/motd' -u devops --become --become-user root
ansible-doc copy
ansible localhost -m copy -a 'content="Managed by Ansible\n" dest=/etc/motd' -u devops --become
ansible localhost -m copy -a 'content="Managed by Ansible\n" dest=/etc/motd' -u devops --become-user root
ansible servera.lab.example.com -m copy -a 'content="Managed by Ansible\n" dest=/etc/motd' -u devops --become-user root
ansible servera.lab.example.com -m copy -a 'content="Managed by Ansible\n" dest=/etc/motd' -u devops --become --become-user root
ansible servera.lab.example.com -m copy -a 'content="Managed by Ansible\n" dest=/etc/motd' -u devops --become-user root
ansible everyone -m command -a 'cat /etc/motd' -u devops
lab adhoc grade
lab deploy-dynamic setup
cd ..
cd dep-dynamic/
vim ansible.cfg
vim inventory
mkdir inventory
cd inventory/
wget http://materials.example.com/dynamic/inventorya.py -O inventory/inventorya.py
wget http://materials.example.com/dynamic/inventorya.py -O inventorya.py
cd ..
wget http://materials.example.com/dynamic/inventoryw.py -O inventory/inventoryw.py
wget http://materials.example.com/dynamic/hosts -O inventory/hosts
ansible -i inventory/inventorya.py webservers --list
ansible -i inventory/inventorya.py webservers --list-hosts
chmod +x inventory/inventorya.py
ansible -i inventory/inventorya.py webservers --list-hosts
ansible -i inventory/inventorypw.py webservers --list-hosts
ansible -i inventory/inventoryw.py webservers --list-hosts
chmod +x inventory/inventoryw.py
ansible -i inventory/inventoryw.py webservers --list-hosts
ansible -i inventory/inventoryw.py --list-hosts
cat inventory/hosts
ansible webservers --list-hosts
mv inventory/inventorya.py inventory/ainventory.py
ansible webservers --list
lab deploy-dynamic grade
lab deploy setup
yum list install ansible
ssh serverb.lab.example.com 'hostname'
ssh devops@serverb
mkdir /home/student/dep-lab
cd /home/student/dep-lab/
vim ansible.cfg
mkdir inventory
cd inventory/
cd ..
wget http://materials.example.com/dynamic/inventory -O inventory/inventory
wget http://materials.example.com/dynamic/binventory.py -O inventory/binventory.py
chmod 755 inventory/binventory.py
vim inventory/inventory
ansible serverb -m command -a 'id'
vim inventory/inventory
cat inventory/binventory.py
wq
ansible serverb.lab.example.com -m command -a 'id'
ansible serverb.lab.example.com -m copy -a 'content="This server is managed by Ansible.\n" dest=/etc/motd' --become
ansible serverb.lab.example.com -m command -a 'cat /etc/motd'
lab deploy grade
mkdir /home/student/imp-yaml
cd /home/student/imp-yaml/
vim dictionaries.yaml
vim numbers.yaml
python -c 'import yaml, sys; print yaml.load(sys.stdin)' < dictionaries.yaml
echo $?
python -c 'import yaml, sys; print yaml.load(sys.stdin)' < numbers.yaml
echo $?
lab yaml grade
lab module setup
cd ..
cd imp-module/
ansible servera.lab.example.com --list
ansible servera.lab.example.com -m ping
ansible servera.lab.example.com -m yum -a "name=httpd state=latest"
ansible servera.lab.example.com -m yum -a "name=httpd state=latest" -b
lab module grade
ansible servera.lab.example.com -m service -a "name=httpd ebabled=yes state=started" -b
ansible servera.lab.example.com -m service -a "name=httpd enabled=yes state=started" -b
lab module grade
lab playbook setup
cd ..
cd imp-playbook/
vim intranet.yaml
ansible-playbook intranet.yaml --syntax-checl
ansible-playbook intranet.yaml --syntax-check
ip a
ansible-playbook intranet.yaml
vim intranet.yaml
ansible-playbook intranet.yaml -vvv
ansible-doc uri
ansible-doc uri -s
ansible-doc uri
lab playbook grade
cd ..
ll
lab playbookinternet setup
ll
cd imp-playbook/
cd ..
cd imp-lab/
ll
cat ansible.cfg
cat inventory
vim internet.yml
ansible-playbook internet.yml --syntax-check
vim internet.yml
ansible-playbook internet.yml --syntax-check
ansible-playbook internet.yml
vim internet.yml
ansible-playbook internet.yml
lab playbookinternet grade
lab manage-variables-playbooks setup
cd ..
cd dev-vars-playbook/
vim playbook.yml
ansible-playbook playbook.yml --syntax-check
ansible-playbook playbook.yml
lab manage-variables-playbooks grade
lab manage-variables-playbooks cleanup
lab manage-variables-facts setup
cd ..
cd dev-vars-facts/
ansible webserver -m setup
ansible webserver -m setup -a "filter=ansible_user*"
vim custom.fact
vim setup_facts.yaml
ansible webserver -m setup -a "filter=ansible_local"
ansible-playbook setup_facts.yaml
vim setup_facts.yaml
ansible-playbook setup_facts.yaml
ansible webserver -m setup -a "filter=ansible_local"
cd ..
ll
yum install git -y
sudo yum install git -y
git add .
git init
git add .
git commit -m "Practice files"
git push
git remote add https://github.com/scimaksim/ansible.git
ll
pwd
git remote add practice https://github.com/scimaksim/ansible.git
ll
git push
git push master origin
git remote add practice https://github.com/scimaksim/ansible.git
git remote add practice https://github.com/scimaksim/ansible.git
git push practice master
git pull
git pull practice
git pull practice master
git push practice master
git-revert
git revert
git revert head
git reset --hard HEAD~1
lab task-control-flowcontrol setup
cd /home/student
ll
cd dev-flowcontrol/
vim configure_database.yml
mv configure_database.yml playbook.yml
vim configure_database.yml
cd ..
git push origin master
git add .
git commit -m "Added dev-flowcontrol dir"
git push
git push origin master
git push practice master
git pull
cd dev-flowcontrol/
LL
vim playbook.yml
ansible-playbook playbook.yml --syntax-check
ansible-playbook playbook.yml
ansible-playbook configure_database.yml --syntax-check
vim configure_database.yml
ansible-playbook configure_database.yml --syntax-check
ansible-playbook playbook.yml
vim playbook.
vim playbook.yml
vim configure_database.yml
ansible-playbook playbook.yml
lab task-control-flowcontrol grade
cd ..
git add .
git commit -m "Completed task-control-flowcontrol lab"
git config --global user.email [email protected]
git config --global user.name "Maksim Nikiforov"
git commit --AMEND --RESET-AUTHOR
git commit --amend -reset-author
git commit --amend --reset-author
git push
git push practice master
git pull practice master
git push practice master
git push practice master
lab task-control-flowcontrol cleanup
lab task-control-handlers setup
cd dev-handlers/
vim configure_db.yml
vim configure_db.yml
ansible-doc mysql_user
ansible-playbook configure_db.yml --syntax-check
ansible-playbook configure_db.yml
ansible-playbook configure_db.yml
vim configure_db.yml
ansible-playbook configure_db.yml
vim configure_db.
vim configure_db.yml
ansible-playbook configure_db.yml
cd ..
git add .
git commit -m "Finished lab-control-handlers lab"
git push practice master
lab task-control-handlers cleanup
lab task-control-tags setup
cd dev-tags/
vim configure_mail.yml
vim playbook.yml
ansible-playbook playbook.yml --syntax-check
ansible-playbook playbook.yml
ansible-playbook playbook.yml
ansible-playbook playbook.yml --tags 'server'
ansible mailservers -a 'yum list installed postfix'
ansible-playbook playbook.yml --skip-tags 'server'
vim configure_mail.yml
lab task-control-tags grade
cd ..
git add .
git commit -m "Completed task-control-tags lab"
git push practice master
lab task-control-tags cleanup
lab task-control-failures setup
cd /home/student
cd dev-failures/
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.yml
ansible databases -a "yum -y remove mariadb-server"
ansible-playbook playbook.
ansible-playbook playbook.yml
ansible-playbook playbook.
ansible-playbook playbook.yml
ansible databases -a "yum -y remove mariadb-server"
vim playbook.yml
ansible databases -a "yum -y remove mariadb-server"
ansible-playbook playbook.yml
ansible databases -a "yum -y remove mariadb-server"
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.yml
ansible-playbook playbook.yml
ssh servera.lab.example.com
vim playbook.yml
ssh servera.lab.example.com
ansible-playbook playbook.yml
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.yml
ansible-playbook playbook.yml
vim playbook.yml
ansible-playbook playbook.yml