Advertisement
sandervanvugt

RHCE ex294 day2 april2021

Apr 13th, 2021
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.08 KB | None | 0 0
  1. [ansible@control lesson8]$ history
  2. 1 userdel -f ansilbe
  3. 2 sudo userdel -f ansilbe
  4. 3 sudo yum install -y git vim bash-completion
  5. 4 git clone https://github.com/sandervanvugt/rhce8-live
  6. 5 git clone https://github.com/sandervanvugt/rhce8-book
  7. 6 git clone https://github.com/sandervanvugt/rhce8
  8. 7 cd rhce8
  9. 8 ls
  10. 9 cd ..
  11. 10 history
  12. 11 ip a
  13. 12 sudo vim /etc/hosts
  14. 13 ping control
  15. 14 ping ansible1
  16. 15 ping ansible2
  17. 16 sudo yum install -y epel-release
  18. 17 sudo yum install -y ansible
  19. 18 ansible --version
  20. 19 id
  21. 20 sudo visudo
  22. 21 ssh ansible1
  23. 22 ssh root@ansible1
  24. 23 ssh root@ansible2
  25. 24 sudo vim /etc/hosts
  26. 25 rm .ssh/known_hosts
  27. 26 ssh-keygen
  28. 27 ssh-copy-id ansible1
  29. 28 ssh-copy-id ansible2
  30. 29 ssh ansible1 ls /root
  31. 30 ssh ansible1
  32. 31 ssh ansible2
  33. 32 history
  34. 33 cd rhce8-live/
  35. 34 ls
  36. 35 ./countdown 12
  37. 36 vim /etc/ansible/hosts
  38. 37 ls
  39. 38 cd lesson2/
  40. 39 ls
  41. 40 cat inventory
  42. 41 cd ..
  43. 42 git clone https://github.com/sandervanvugt/ansible-advanced
  44. 43 cd ansible-advanced/
  45. 44 ls
  46. 45 cat advanced/inventory
  47. 46 cat windows/inventory
  48. 47 cd ..
  49. 48 cd rhce8-live/
  50. 49 cd lesson2/
  51. 50 ls ..
  52. 51 vim inventory
  53. 52 vim ansible.cfg
  54. 53 ls
  55. 54 ansible -i inventory all --list-hosts
  56. 55 ansible file --list-hosts
  57. 56 cat ansible.cfg
  58. 57 ansible all --list-hosts
  59. 58 cat inventory
  60. 59 ansible web --list-hosts
  61. 60 ../countdown 4
  62. 61 history | grep git
  63. 62 pwd
  64. 63 vim ansible.cfg
  65. 64 vim /etc/ansible/ansible.cfg
  66. 65 ansible --version
  67. 66 ansible -u root -k -i inventory all -a 'id'
  68. 67 ansible localhost -m command -a "useradd bob"
  69. 68 id
  70. 69 ../countdown 15
  71. 70 ansible all -m command -a "useradd bob"
  72. 71 ansible all -m user -a "name=bob"
  73. 72 ansible all -a "id bob"
  74. 73 ansible all -a "rpm -qa | grep nmap"
  75. 74 ansible all -m shell -a "rpm -qa | grep nmap"
  76. 75 ansible-doc yum
  77. 76 ansible all -m yum -a "name=nmap"
  78. 77 history | tail -5
  79. 78 ansible all -m ping
  80. 79 ansible all -u root -k -m raw -a "yum install python"
  81. 80 #ansible all -u root -k -m raw -a "yum install python"
  82. 81 ansible all -m service -a "name=httpd state=started"
  83. 82 ansible all -m service -a "name=sshd state=started"
  84. 83 ansible all -m copy -a 'content=hello world dest=/etc/motd'
  85. 84 ansible all -m copy -a 'content="hello world" dest=/etc/motd'
  86. 85 ansible-doc -l
  87. 86 ansible-doc -l | wc
  88. 87 ansible-doc | grep windows
  89. 88 ansible-doc -l | grep windows
  90. 89 ansible-doc -l | grep win
  91. 90 ansible-doc -l
  92. 91 ansible-doc consul_session
  93. 92 less /usr/lib/python3.6/site-packages/ansible/modules/clustering/consul_session.py
  94. 93 ../countdown 3
  95. 94 cd ..
  96. 95 ls
  97. 96 cd lesson4/
  98. 97 ls
  99. 98 vim vsftpd.yml
  100. 99 ansible-doc yum
  101. 100 ansible-doc service
  102. 101 vim vsftpd.yml
  103. 102 ansible-playbook vsftpd.yml
  104. 103 ../countdown 12
  105. 104 vim vsftpd.yml
  106. 105 ansible-playbook vsftpd.yml
  107. 106 vim vsftpd.yml
  108. 107 vim ~/.vimrc
  109. 108 vim nidempotent.yaml
  110. 109 ansible-doc copy
  111. 110 ansible-playbook nidempotent.yaml
  112. 111 cat nidempotent.yaml
  113. 112 ansible all -m file -a "path=random.txt state=absent"
  114. 113 ansible all -m file -a "path=/home/linda/random.txt state=absent"
  115. 114 cat nidempotent.yaml
  116. 115 ansible-playbook nidempotent.yaml
  117. 116 vim nidempotent.yaml
  118. 117 ansible-playbook nidempotent.yaml
  119. 118 ansible-playbook -vvvv nidempotent.yaml
  120. 119 lls
  121. 120 ls
  122. 121 vim web-setup-and-test.yml
  123. 122 ansible-playbook web-setup-and-test.yml
  124. 123 vim nidempotent.yaml
  125. 124 history
  126. 125 ../countdown 3
  127. 126 ls
  128. 127 vim uninstall-httpd.yml
  129. 128 vim 123.yaml
  130. 129 ansible-playbook 123.yaml
  131. 130 cd ../lesson5/
  132. 131 ls
  133. 132 vim user.yml
  134. 133 ansible-playbook user.yml
  135. 134 ansible-playbook --help | less
  136. 135 ansible-playbook user.yml -e user=linda
  137. 136 vim user.yml
  138. 137 mkdir vars
  139. 138 vim vars/users.yaml
  140. 139 ansible-playbook user.yml
  141. 140 vim user.yml
  142. 141 ansible-playbook user.yml
  143. 142 vim vars/users.yaml
  144. 143 ansible-playbook user.yml
  145. 144 vim user.yml
  146. 145 ansible-playbook user.yml
  147. 146 vim user.yml
  148. 147 ansible-playbook user.yml
  149. 148 vim user.yml
  150. 149 vim vars/users.yaml
  151. 150 ansible-doc user
  152. 151 vim vars/users.yaml
  153. 152 vim user.yml
  154. 153 ansible-playbook user.yml
  155. 154 vim user.yml
  156. 155 ansible-playbook user.yml
  157. 156 vim user.yml
  158. 157 ls
  159. 158 vim inventory
  160. 159 cd webservers/
  161. 160 ls
  162. 161 vim inventory
  163. 162 vim group_vars/lamp
  164. 163 vim site.yml
  165. 164 ansible-playbook site.yml
  166. 165 vim site.yml
  167. 166 cat inventory
  168. 167 mkdir host_vars
  169. 168 cat site.yml
  170. 169 vim hosts_vars/ansible1.example.com
  171. 170 ls -ld .
  172. 171 vim host_vars/ansible1.example.com
  173. 172 ansible-playbook site.yml
  174. 173 vim site.yml
  175. 174 ansible-playbook site.yml
  176. 175 vim site.yml
  177. 176 ansible-playbook site.yml
  178. 177 vim site.yml
  179. 178 ansible-playbook site.yml
  180. 179 vim site.yml
  181. 180 ansible-playbook site.yml
  182. 181 cd ..
  183. 182 ls
  184. 183 cd ..
  185. 184 cd lesson6
  186. 185 cd lesson4/
  187. 186 ls
  188. 187 vim web-setup-and-test.yml
  189. 188 ansible-vault --help
  190. 189 cd ../lesson7/
  191. 190 ls
  192. 191 cd vault/
  193. 192 ;s
  194. 193 ls
  195. 194 ansible-vault create secret.yml
  196. 195 cat secret.yml
  197. 196 vim create-user.yml
  198. 197 ansible-playbook create-user.yml
  199. 198 ansible-playbook --ask-vault-pass create-user.yml
  200. 199 ansible all -a "tail -1 /etc/passwd"
  201. 200 ansible all -a "tail -5 /etc/passwd"
  202. 201 ansible all -a "tail -5 /etc/shadow"
  203. 202 history
  204. 203 echo password > vault-pass
  205. 204 ansible-playbook --vault-password-file=vault-pass create-user.yml
  206. 205 mkdir test
  207. 206 echo one > test/one
  208. 207 echo two > test/two
  209. 208 ansible-vault -h
  210. 209 ansible-vault create test/
  211. 210 ansible-vault encrypt test/
  212. 211 history
  213. 212 ansible all -m setup
  214. 213 ansible all -m setup > ../facts.txt
  215. 214 cd ..
  216. 215 less facts.txt
  217. 216 ansible-doc -l | grep fact
  218. 217 ansible-doc -l | grep fact | grep pack
  219. 218 ls
  220. 219 cd facts/
  221. 220 ls
  222. 221 vim facts.yml
  223. 222 vim ipfact.yml
  224. 223 ansible-playbook ipfact.yml
  225. 224 vim ipfact.yml
  226. 225 pwd
  227. 226 history | grep git
  228. 227 vim ipfact.yml
  229. 228 less ../facts.txt
  230. 229 vim ipfact.yml
  231. 230 pwd
  232. 231 ../../countdown 12
  233. 232 history
  234. 233 ansible-doc copy
  235. 234 vim ipfact.yml
  236. 235 ansible-playbook ipfact.yml
  237. 236 vim ipfact.yml
  238. 237 la
  239. 238 ls
  240. 239 vim newlocalfacts.yml
  241. 240 vim localfacts.fact
  242. 241 vim newlocalfacts.yml
  243. 242 ansible-playbook newlocalfacts.yml
  244. 243 ansible lamp -m setup -a "filter=ansible_local"
  245. 244 vim newlocalfacts.yml
  246. 245 ansible-playbook newlocalfacts.yml
  247. 246 vim newlocalfacts.yml
  248. 247 ansible-playbook newlocalfacts.yml
  249. 248 vim newlocalfacts.yml
  250. 249 pwd
  251. 250 ../../countdown 5
  252. 251 ls
  253. 252 cp localfacts.yml
  254. 253 cp localfacts.yml ansible1.yml
  255. 254 cp localfacts.yml ansible2.yml
  256. 255 vim ansible1.yml
  257. 256 cp localfact.yml ansible2.yml
  258. 257 cp localfacts.fact ansible1.fact
  259. 258 cp localfacts.fact ansible2.fact
  260. 259 vim ansible1.fact
  261. 260 vim ansible2.fact
  262. 261 cp newlocalfacts.yml lab4.yml
  263. 262 vim lab4.yml
  264. 263 ansible-playbook lab4.yml
  265. 264 vim lab4.yml
  266. 265 ansible-playbook lab4.yml
  267. 266 ansible all -m setup -a "filter=ansible_local"
  268. 267 vim wa.yaml
  269. 268 vim myfact.fact
  270. 269 ansible-playbook wa.yaml
  271. 270 vim myfact.fact
  272. 271 vim wa.yaml
  273. 272 vim myfact.fact
  274. 273 ansible-playbook wa.yaml
  275. 274 vim wa.yaml
  276. 275 ansible all -m command -a "ls /etc/ansible/facts.d"
  277. 276 vim wa.yaml
  278. 277 cat myfact.fact
  279. 278 ansible all -m setup -a "filter=ansible_local"
  280. 279 ls *fact
  281. 280 for i in *; do echo $i; cat $i; done
  282. 281 for i in *fact; do echo $i; cat $i; done
  283. 282 vim ansible1.fact
  284. 283 vim ansible2.fact
  285. 284 ls -lrt
  286. 285 vim lab4.yml
  287. 286 ansible-playbook lab4.yml
  288. 287 ansible all -m setup -a "filter=ansible_local"
  289. 288 ansible-playbook lab4.yml
  290. 289 vim lab4.yml
  291. 290 history
  292. 291 pwd
  293. 292 ../../countdown 12
  294. 293 ls
  295. 294 vim ansible.cfg
  296. 295 cd ../..
  297. 296 cd lesson4/
  298. 297 ls
  299. 298 vim remoteuser.yaml
  300. 299 ansible-playbook remoteuser.yaml
  301. 300 ansible-playbook remoteuser.yaml -k
  302. 301 cat remoteuser.yaml
  303. 302 vim remoteuser.yaml
  304. 303 ansible-playbook remoteuser.yaml -k
  305. 304 cd ../lesson7/
  306. 305 l;s
  307. 306 ls
  308. 307 cd arrays/
  309. 308 ls
  310. 309 vim vars/users-dictionary
  311. 310 vim vars/users-list
  312. 311 vim multi-list.yml
  313. 312 vim vars/users-list
  314. 313 vim multi-list.yml
  315. 314 ansible-playbook multi-list.yml
  316. 315 vim multi-list.yml
  317. 316 vim multi-dictionary.yml
  318. 317 ansible-playbook multi-dictionary.yml
  319. 318 cd ..
  320. 319 cd ../lesson8/
  321. 320 ls
  322. 321 vim loopservices.yml
  323. 322 ansible-playbook loopservices.yml
  324. 323 vim loopusers.yml
  325. 324 ansible-playbook loopusers.yml
  326. 325 vim loop-over-variable.yml
  327. 326 cat loopvars.yml
  328. 327 ansible-playbook loopvars.yml
  329. 328 ansible-playbook loop-over-variable.yml
  330. 329 vim register_loop.yml
  331. 330 ansible-playbook register_loop.yml
  332. 331 vim register_loop.yml
  333. 332 vim register_command.yml
  334. 333 ansible-playbook register_command.yml
  335. 334 vim register_command.yml
  336. 335 ../countdown 12
  337. 336 ls
  338. 337 vim distro.yml
  339. 338 ansible-playbook distro.yml
  340. 339 vim distro.yml
  341. 340 ansible-playbook distro.yml
  342. 341 ansible-playbook distro.yml -e mypackage=nmap
  343. 342 vim quicktest.yml
  344. 343 ansible-playbook quicktest.yml
  345. 344 vim quicktest.yml
  346. 345 ansible-playbook quicktest.yml
  347. 346 vim quicktest.yml
  348. 347 ansible-playbook quicktest.yml
  349. 348 vim command-output-test.yml
  350. 349 vgs
  351. 350 sudo vgs
  352. 351 vim command-output-test.yml
  353. 352 ansible-playbook command-output-test.yml
  354. 353 ansible ansible1.example.com -a "vgs"
  355. 354 vim command-output-test.yml
  356. 355 ansible ansible1.example.com -a "vgs"
  357. 356 vim command-output-test.yml
  358. 357 ansible-playbook command-output-test.yml
  359. 358 ls
  360. 359 vim when_multiple.yml
  361. 360 ansible-playbook when_multiple
  362. 361 ansible-playbook when_multiple.yml
  363. 362 ansible-playbook when_multiple
  364. 363 vim when_multiple.yml
  365. 364 ansible-playbook when_multiple.yml
  366. 365 vim when_multiple_complex.yml
  367. 366 ansible-playbook when_multiple_complex.yml
  368. 367 vim ifsize.yml
  369. 368 ansible-playbook ifsize.yml
  370. 369 ansible-playbook ifsize.yml -e package=nmap
  371. 370 vim restart.yml
  372. 371 ansible-playbook restart.yml
  373. 372 ls
  374. 373 cd ..
  375. 374 find . -name with_size.yaml
  376. 375 find . -name with_size.yml
  377. 376 cd ..
  378. 377 find . -name with_size.yml
  379. 378 ls
  380. 379 cd rhce8-live/lesson8/
  381. 380 cat ifsize.yml
  382. 381 history
  383.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement