sandervanvugt

RHCE day4 dec21

Dec 23rd, 2021
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.25 KB | None | 0 0
  1. [ansible@control lesson16]$ history
  2. 1 sudo dnf install -y epel-release
  3. 2 cat /etc/redhat-release
  4. 3 sudo dnf install ansible
  5. 4 ansible --version
  6. 5 history
  7. 6 sudo dnf install vim git -y
  8. 7 git clone https://github.com/sandervanvugt/rhce8-live
  9. 8 cd rhce8-live/
  10. 9 ls
  11. 10 cd
  12. 11 ip a
  13. 12 sudo vim /etc/hosts
  14. 13 ping ansible1
  15. 14 ping ansible2
  16. 15 ssh root@ansible1
  17. 16 ssh root@ansible2
  18. 17 history
  19. 18 cd rhce8-live/
  20. 19 ls
  21. 20 ./countdown 12
  22. 21 ansible-doc -l
  23. 22 ansible-doc -l | grep user
  24. 23 mkdir setup
  25. 24 cd setup/
  26. 25 vim inventory
  27. 26 ansible-doc user
  28. 27 ansible all -m user -a "name=ansible"
  29. 28 ansible all -m user -a "name=ansible" -i inventory
  30. 29 ansible all -m user -a "name=ansible" -i inventory -k
  31. 30 ansible all -m user -a "name=bob" -i inventory -k
  32. 31 ansible all -m user -a "name=bob" -i inventory -k -u root
  33. 32 ansible all -m user -a "name=ansible state=absent" -i inventory -k -u root
  34. 33 history
  35. 34 cat inventory
  36. 35 ansible all -m command -a "tail -3 /etc/passwd"
  37. 36 ansible all -m command -a "tail -3 /etc/passwd" -i inventory
  38. 37 ansible all -m command -a "tail -3 /etc/passwd" -i inventory -u root -k
  39. 38 ansible all -m user -a "name=ansible state=present" -i inventory -k -u root
  40. 39 ssh ansible@ansible2
  41. 40 history
  42. 41 sudo -i
  43. 42 ansible -i inventory all -m command -a "rpm -qa | grep util" -u root -k
  44. 43 ansible -i inventory all -m shell -a "rpm -qa | grep util" -u root -k
  45. 44 ansible -i inventory all -m shell -a "echo password | passwd --stdin ansible" -u root -k
  46. 45 ssh ansible@ansible1
  47. 46 ansible -i inventory all -m command -a "chown -R ansible:ansible /home/ansible" -u root -k
  48. 47 ansible -i inventory all -m command -a "ls -al /home/ansible" -u root -k
  49. 48 ssh ansible1
  50. 49 ssh ansible2
  51. 50 sudo vim /etc/hosts
  52. 51 history
  53. 52 ansible-doc copy
  54. 53 history
  55. 54 ansible -i inventory all -m copy -a 'content="ansible ALL=(ALL) NOPASSWD: ALL" -dest=/etc/sudoers.d/ansible' -u root -k
  56. 55 cat ~/.ssh/known_hosts
  57. 56 rm -f ~/.ssh/known_hosts
  58. 57 ansible -i inventory all -m copy -a 'content="ansible ALL=(ALL) NOPASSWD: ALL" -dest=/etc/sudoers.d/ansible' -u root -k
  59. 58 ssh ansible1
  60. 59 ssh ansible2
  61. 60 cat ~/.ssh/known_hosts
  62. 61 ansible -i inventory all -m copy -a 'content="ansible ALL=(ALL) NOPASSWD: ALL" -dest=/etc/sudoers.d/ansible' -u root -k
  63. 62 ansible -i inventory all -m copy -a 'content="ansible ALL=(ALL) NOPASSWD: ALL" dest=/etc/sudoers.d/ansible' -u root -k
  64. 63 ansible -i inventory all -m user -a "name=bob" -u ansible -k
  65. 64 ansible -i inventory all -m user -a "name=alice" -u ansible -k
  66. 65 ansible -i inventory all -m user -a "name=alice" -u ansible -k -b
  67. 66 ssh-keygen
  68. 67 ssh-copy-id ansible1
  69. 68 ssh-copy-id ansible2
  70. 69 ansible -i inventory all -m user -a "name=bob state=absent" -u ansible -b
  71. 70 history
  72. 71 ../countdown 12
  73. 72 sudo vim /etc/ansible/hosts
  74. 73 cd ../
  75. 74 ls
  76. 75 cd lesson2/
  77. 76 ls
  78. 77 cat inventory
  79. 78 ansible -i inventory all --list-hosts
  80. 79 ansible -i inventory web --list-hosts
  81. 80 vim ansible.cfg
  82. 81 sudo vim /etc/ansible/ansible.cfg
  83. 82 pwd
  84. 83 vim ansible.cfg
  85. 84 ansible all -m command -a "chown -R ansible:ansible /home/ansible"
  86. 85 vim ansible.cfg
  87. 86 ansible all -m command -a "chown -R ansible:ansible /home/ansible"
  88. 87 ansible --version
  89. 88 vim ansible.cfg
  90. 89 ansible localhost -m user -a "name=lisa"
  91. 90 vim ansible.cfg
  92. 91 sudo visudo
  93. 92 ansible localhost -m user -a "name=lisa"
  94. 93 echo $EDITOR
  95. 94 EDIT=/usr/bin/nano
  96. 95 export EDITOR=/usr/bin/nano
  97. 96 alias nanosudo=visudo
  98. 97 nanosudo
  99. 98 sudo nanosudo
  100. 99 ansible all -a "id lisa"
  101. 100 vim inventory
  102. 101 ansible all -m user -a "name=linda"
  103. 102 ansible all -m command -a "useradd bill"
  104. 103 ansible all -m user -a "name=bill"
  105. 104 history
  106. 105 ansible-doc user
  107. 106 ../countdown 15
  108. 107 ansible all -m package -a "name=nmap state=latest"
  109. 108 ansible all -m shell -a "rpm -qa | grep nmap"
  110. 109 ansible all -m service -a "name=httpd state=started"
  111. 110 cd ../lesson4/
  112. 111 ls
  113. 112 vim install-httpd.yml
  114. 113 ansible-doc copy
  115. 114 ansible-doc sync
  116. 115 ansible-doc -l | grep sync
  117. 116 ansible-doc synchronize
  118. 117 ls
  119. 118 vim vsftpd.yml
  120. 119 ansible-playbook vsftpd.yml
  121. 120 vim vsftpd.yml
  122. 121 ansible-doc service
  123. 122 vim vsftpd.yml
  124. 123 ansible-playbook vsftpd.yml
  125. 124 vim vsftpd.yml
  126. 125 ansible-playbook vsftpd.yml
  127. 126 vim vsftpd.yml
  128. 127 ansible-playbook -v vsftpd.yml
  129. 128 vim vsftpd.yml
  130. 129 ansible-playbook -v vsftpd.yml
  131. 130 ansible-playbook -vvvv vsftpd.yml
  132. 131 ansible-doc chkconfig
  133. 132 which chkconfig
  134. 133 ls -l /usr/sbin/chkconfig
  135. 134 sudo dnf provides */ansible-lint
  136. 135 sudo dnf install python3-ansible-lint
  137. 136 ansible-lint vsftpd.yml
  138. 137 ansible --syntax-check vsftpd.yml
  139. 138 ansible -C vsftpd.yml
  140. 139 ansible-playbook --syntax-check vsftpd.yml
  141. 140 history
  142. 141 history | less
  143. 142 cd ../lesson5/
  144. 143 ls
  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 inventory
  151. 150 ansible-playbook user.yml -e user=anna
  152. 151 vim user.yml
  153. 152 ansible-playbook user.yml -e user=anna
  154. 153 cd ../..
  155. 154 git clone https://github.com/sandervanvugt/ansibleinthreeweeks
  156. 155 cd ansibleinthreeweeks/
  157. 156 cd windows/
  158. 157 vim inventory
  159. 158 cd ../azure/
  160. 159 cd ../aws
  161. 160 cd ..
  162. 161 cd ../rhce8-live/lesson5/
  163. 162 ls
  164. 163 cd webservers/
  165. 164 ls
  166. 165 vim site.yml
  167. 166 cat inventory
  168. 167 ls group_vars/
  169. 168 cat group_vars/lamp
  170. 169 ansible-playbook site.yml
  171. 170 cd ../../..
  172. 171 cd ansibleinthreeweeks/
  173. 172 grep -R 'vars:'
  174. 173 cd cisco/
  175. 174 vim inventory-ios
  176. 175 cd ../../rhce8-live/lesson5/
  177. 176 ls
  178. 177 cat install_services.yml
  179. 178 cat packages.fact
  180. 179 cd ../lesson4/
  181. 180 ls
  182. 181 vim install-httpd.yml
  183. 182 cp install-httpd.yml uninstall-httpd.yml
  184. 183 vim uninstall-httpd.yml
  185. 184 ansible-playbook uninstall-httpd.yml
  186. 185 vim uninstall-httpd.yml
  187. 186 ansible-playbook uninstall-httpd.yml
  188. 187 vim uninstall-httpd.yml
  189. 188 ansible-playbook uninstall-httpd.yml
  190. 189 vim install-httpd.yml
  191. 190 ansible-playbook install-httpd.yml
  192. 191 ansible-playbook uninstall-httpd.yml
  193. 192 cd ../lesson7/
  194. 193 ansible-vault --help
  195. 194 ansible-vault create secrets.yaml
  196. 195 export EDITOR=/usr/bin/vim
  197. 196 alias
  198. 197 unalias nanosudo
  199. 198 cat secrets.yaml
  200. 199 ls
  201. 200 rm secrets.yaml
  202. 201 ansible-vault create secret.yml
  203. 202 mv secret.yml vault/
  204. 203 cd vault/
  205. 204 ls
  206. 205 vim create-user.yml
  207. 206 ansible-playbook create-user.yml
  208. 207 ansible-playbook --ask-vault-pass create-user.yml
  209. 208 ansible ansible2.example.com -a "tail -2 /etc/shadow"
  210. 209 echo password > vault-pass
  211. 210 rm vault-pass
  212. 211 echo password > ~/vault-pass
  213. 212 vim create-user.yml
  214. 213 ansible-playbook --vault-password-file=../../vault-pass create-user.yml
  215. 214 ansible-playbook --vault-password-file=../../../vault-pass create-user.yml
  216. 215 ansible-playbook --vault-password-file=~/vault-pass create-user.yml
  217. 216 vim lab4.txt
  218. 217 vim dg.yaml
  219. 218 ../../countdown 5
  220. 219 vim ansible1.fact
  221. 220 vim lab5.yaml
  222. 221 ansible-playbook lab5.yaml
  223. 222 vim lab5.yaml
  224. 223 ansible-playbook lab5.yaml
  225. 224 ansible ansible1.example.com -m setup -a "filter=ansible_local"
  226. 225 cat lab5.yaml
  227. 226 cat ansible1
  228. 227 cat ansible1.fact
  229. 228 eixt
  230. 229 exit
  231. 230 ../../countdown 15
  232. 231 vim setupfactcache.yaml
  233. 232 ansible-playbook setupfactcache.yaml
  234. 233 pwd
  235. 234 ip a
  236. 235 ls
  237. 236 pwd
  238. 237 ../../countdown 12
  239. 238 ansible-doc copy
  240. 239 ansible-doc firewalld
  241. 240 ansible-doc file
  242. 241 history | less
  243. 242 pwd
  244. 243 vim dg.yaml
  245. 244 cd ../lesson7/
  246. 245 ansible ansible1.example.com -m setup > facts.txt
  247. 246 ls
  248. 247 cd facts
  249. 248 ls
  250. 249 ansible ansible1.example.com -m setup > facts.txt
  251. 250 less facts.txt
  252. 251 ansible-doc -l | grep fact
  253. 252 pwd
  254. 253 vim ../../ansible.cfg
  255. 254 cp ../../lesson5/ansible.cfg
  256. 255 cp ../../lesson5/ansible.cfg ../../
  257. 256 vim ../../ansible.cfg
  258. 257 cp ../../ansible.cfg .
  259. 258 sudo dnf install -y redis
  260. 259 sudo systemctl enable --now redis
  261. 260 sudo pip3 install redis
  262. 261 ansible all -m setup
  263. 262 ls
  264. 263 vim facts.yml
  265. 264 cat ansible.cfg
  266. 265 ansible-playbook facts.yml
  267. 266 cat facts.yml
  268. 267 sudo systemctl status redis
  269. 268 history
  270. 269 cat ansible.cfg
  271. 270 cd
  272. 271 mv rhce8-live rhce8-live.old
  273. 272 git clone https://github.com/sandervanvugt/rhce8-live
  274. 273 cd rhce8-live/lesson7/facts/
  275. 274 l;s
  276. 275 ls
  277. 276 vim ipfact.yml
  278. 277 ansible-playbook ipfact.yml
  279. 278 vim ipfact.yml
  280. 279 ansible-playbook ipfact.yml
  281. 280 cat ipfact.yml
  282. 281 ls
  283. 282 vim newlocalfacts.yml
  284. 283 vim localfacts.fact
  285. 284 ansible-playbook newlocalfacts.yml
  286. 285 ansible all -m setup -a "filter=ansible_local"
  287. 286 vim localfacts.fact
  288. 287 history
  289. 288 cat localfacts.fact
  290. 289 cat newlocalfacts.yml
  291. 290 cd ../arrays/
  292. 291 ls
  293. 292 cat vars/users-dictionary
  294. 293 cat vars/users-list
  295. 294 vim multi-list.yml
  296. 295 ansible-playbook multi-list.yml
  297. 296 vim multi-dictionary.yml
  298. 297 ansible-playbook multi-dictionary.yml
  299. 298 cd ../..
  300. 299 ./countdown 12
  301. 300 ls
  302. 301 vim loop-over-dict.yaml
  303. 302 mv loop-over-dict.yaml lesson7/arrays/
  304. 303 cd lesson7/arrays/
  305. 304 vim loop-over-dict.yaml
  306. 305 cat vars/users-dictionary
  307. 306 vim loop-over-dict.yaml
  308. 307 ansible-playbook loop-over-dict.yaml
  309. 308 cd ../..
  310. 309 ls
  311. 310 cd lesson8/
  312. 311 ls
  313. 312 vim loopservices.yml
  314. 313 ansible-playbook loopservices.yml
  315. 314 ansible-doc yum
  316. 315 ansible-doc package
  317. 316 vim loopusers.yml
  318. 317 vim loop-over-variable.yml
  319. 318 cat loopvars.yml
  320. 319 ansible-playbook loop-over-variable.yml
  321. 320 vim register_loop.yml
  322. 321 ansible-playbook register_loop.yml
  323. 322 vim register_loop.yml
  324. 323 ansible-playbook register_loop.yml
  325. 324 vim register_command.yml
  326. 325 ansible-playbook register_command.yml
  327. 326 vim register_command.yml
  328. 327 ansible-playbook register_command.yml
  329. 328 history
  330. 329 exit
  331. 330 history
  332. 331 cd rhce8-live
  333. 332 cd lesson8/
  334. 333 ;s
  335. 334 ls
  336. 335 cd ../lesson5/
  337. 336 ls
  338. 337 vim ansible.cfg
  339. 338 sudo vim /etc/ansible/ansible.cfg
  340. 339 vim ansible.cfg
  341. 340 sudo vim /etc/ansible/ansible.cfg
  342. 341 time all -m setup
  343. 342 time ansible all -m setup
  344. 343 vim ansible.cfg
  345. 344 time ansible all -m setup
  346. 345 ls
  347. 346 vim packages.fact
  348. 347 vim install_services.yml
  349. 348 vim user.yml
  350. 349 ansible-playbook user.yml
  351. 350 vim user.yml
  352. 351 ansible-playbook user.yml
  353. 352 vim user.yml
  354. 353 ansible-playbook user.yml
  355. 354 vim global-update-ansible-cfg.yaml
  356. 355 ansible-playbook global-update-ansible-cfg.yaml
  357. 356 vim global-update-ansible-cfg.yaml
  358. 357 ansible-playbook global-update-ansible-cfg.yaml
  359. 358 vim global-update-ansible-cfg.yaml
  360. 359 ansible-playbook global-update-ansible-cfg.yaml
  361. 360 vim global-update-ansible-cfg.yaml
  362. 361 ansible-playbook global-update-ansible-cfg.yaml
  363. 362 vim global-update-ansible-cfg.yaml
  364. 363 ansible-playbook global-update-ansible-cfg.yaml
  365. 364 vim global-update-ansible-cfg.yaml
  366. 365 ansible-playbook global-update-ansible-cfg.yaml
  367. 366 vim global-update-ansible-cfg.yaml
  368. 367 ansible-playbook global-update-ansible-cfg.yaml
  369. 368 vim global-update-ansible-cfg.yaml
  370. 369 ansible-playbook global-update-ansible-cfg.yaml
  371. 370 vim global-update-ansible-cfg.yaml
  372. 371 ansible-playbook global-update-ansible-cfg.yaml
  373. 372 vim global-update-ansible-cfg.yaml
  374. 373 ansible-playbook global-update-ansible-cfg.yaml
  375. 374 vim global-update-ansible-cfg.yaml
  376. 375 ansible-playbook global-update-ansible-cfg.yaml
  377. 376 vim global-update-ansible-cfg.yaml
  378. 377 cd ../lesson7/facts/
  379. 378 ls
  380. 379 cat changeconfig.yaml
  381. 380 pwd
  382. 381 ls
  383. 382 cat setupfactcache.yaml
  384. 383 vim changeconfig.yaml
  385. 384 ansible-playbook changeconfig.yaml
  386. 385 vim ansible.cfg
  387. 386 ansible-playbook changeconfig.yaml
  388. 387 less ../../lesson5/ansible.cfg
  389. 388 vim changeconfig.yaml
  390. 389 ansible-playbook changeconfig.yaml
  391. 390 less ../../lesson5/ansible.cfg
  392. 391 vim ansible.cfg
  393. 392 cd ../../lesson5/
  394. 393 ls
  395. 394 time ansible all -m setup
  396. 395 vim ansible.cfg
  397. 396 cd ../lesson7/facts/
  398. 397 ls
  399. 398 vim checkcache.py
  400. 399 ./checkcache.py
  401. 400 cd ../../lesson5/
  402. 401 vim user.yml
  403. 402 ansible-playbook user.yml
  404. 403 cd ../lesson7/facts/
  405. 404 ls
  406. 405 cd ../../lesson8/
  407. 406 ls
  408. 407 vim distro.yml
  409. 408 ansible-playbook distro.yml -e mypackage=nmap
  410. 409 vim distro.yml
  411. 410 ansible-playbook distro.yml -e mypackage=nmap
  412. 411 vim distro.yml
  413. 412 ansible-playbook distro.yml -e mypackage=nmap
  414. 413 vim distro.yml
  415. 414 ansible-playbook distro.yml -e mypackage=nmap
  416. 415 vim quicktest.yml
  417. 416 ansible-playbook quicktest.yml
  418. 417 vim quicktest.yml
  419. 418 ansible-playbook quicktest.yml
  420. 419 vim quicktest.yml
  421. 420 ansible-playbook quicktest.yml
  422. 421 vim command-output-test.yml
  423. 422 ansible-playbook command-output-test.yml
  424. 423 vim command-output-test.yml
  425. 424 ansible-playbook command-output-test.yml
  426. 425 ansible all -a "vgs"
  427. 426 vim command-output-test.yml
  428. 427 ansible-playbook command-output-test.yml
  429. 428 vim when_multiple.yml
  430. 429 ansible-playbook when_multiple.yml
  431. 430 vim when_multiple.yml
  432. 431 ansible-playbook when_multiple.yml
  433. 432 vim when_multiple.yml
  434. 433 ansible-playbook when_multiple.yml
  435. 434 vim when_multiple.yml
  436. 435 ansible-playbook when_multiple.yml
  437. 436 vim when_multiple_complex.yml
  438. 437 ansible-playbook when_multiple.yml
  439. 438 vim when_multiple_complex.yml
  440. 439 ls
  441. 440 vim ifsize.yml
  442. 441 ansible-playbook ifsize.yml
  443. 442 vim restart.yml
  444. 443 ansible-playbook restart.yml
  445. 444 ansible ansible1.example.com -a "systemctl stop crond"
  446. 445 ansible-playbook restart.yml
  447. 446 vim restart.yml
  448. 447 ansible-playbook restart.yml
  449. 448 vim ss.yaml
  450. 449 ansible-playbook ss.yaml
  451. 450 cat inventory
  452. 451 vim ss.yaml
  453. 452 ansible-playbook ss.yaml
  454. 453 vim ss.yaml
  455. 454 ansible-playbook ss.yaml
  456. 455 vim ss.yaml
  457. 456 ansible-playbook ss.yaml
  458. 457 vim ss.yaml
  459. 458 ansible-playbook ss.yaml
  460. 459 ansible ansible1.example.com -m package -a "name=vsftpd state=absent"
  461. 460 ansible-playbook ss.yaml
  462. 461 vim ss.yaml
  463. 462 ../countdown 12
  464. 463 vim handlers.yml
  465. 464 touch /tmp/index.html
  466. 465 ansible-playbook handlers.yml
  467. 466 vim handlers.yml
  468. 467 ansible-playbook handlers.yml
  469. 468 ansible all -m file -a "name=/var/www/html/index.html state=absent"
  470. 469 ansible-playbook handlers.yml
  471. 470 vim blocks.yml
  472. 471 ansible-playbook blocks.yml
  473. 472 vim ansible.cfg
  474. 473 ansible all -m setup
  475. 474 ansible-playbook blocks.yml
  476. 475 ls
  477. 476 cd ..
  478. 477 find . -name "blocks2.y*"
  479. 478 cd lesson8/
  480. 479 ls
  481. 480 vim failure.yml
  482. 481 ansible-playbook failure.yml
  483. 482 ls
  484. 483 cd ..
  485. 484 git pull
  486. 485 cd ..
  487. 486 mv rhce8-live rhce8-live.two
  488. 487 git clone https://github.com/sandervanvugt/rhce8-live
  489. 488 cd rhce8-live/lesson8/
  490. 489 ls
  491. 490 vim listing725.yaml
  492. 491 ansible-playbook listing725.yaml
  493. 492 lsblk
  494. 493 ../countdown 6
  495. 494 vim dg.yaml
  496. 495 ansible-playbook dg.yaml
  497. 496 ansible all -m setup
  498. 497 ansible-playbook dg.yaml
  499. 498 ansible-playbook --help | grep cache
  500. 499 ansible-playbook dg.yaml --flush-cache
  501. 500 sudo systemctl stop redis
  502. 501 sudo systemctl start redis
  503. 502 ansible all -m setup
  504. 503 ansible-playbook dg.yaml --flush-cache
  505. 504 ansible all -a "lsblk"
  506. 505 vim dg.yaml
  507. 506 ansible-playbook dg.yaml
  508. 507 vim dg.yaml
  509. 508 ansible-playbook dg.yaml
  510. 509 vim dg.yaml
  511. 510 vim dgg.yaml
  512. 511 ansible-playbook dgg.yaml
  513. 512 vim dgg.yaml
  514. 513 ansible-playbook dgg.yaml
  515. 514 vim dgg.yaml
  516. 515 cd ../lesson7/facts/
  517. 516 ls
  518. 517 vim checkcache.py
  519. 518 ./checkcache.py
  520. 519 vim checkcache.py
  521. 520 ./checkcache.py
  522. 521 vim checkcache.py
  523. 522 ./checkcache.py
  524. 523 ./checkcache.py | grep sdb
  525. 524 pwd
  526. 525 ../../countdown 12
  527. 526 cd ../../lesson9/
  528. 527 ls
  529. 528 vim file.yml
  530. 529 ansible-doc file
  531. 530 ansible-playbook file.yml
  532. 531 vim copy.yml
  533. 532 ansible-playbook copy.yml
  534. 533 vim copy.yml
  535. 534 ansible-playbook copy.yml
  536. 535 vim copy.yml
  537. 536 ansible-playbook copy.yml
  538. 537 vim copy.yml
  539. 538 ansible-playbook copy.yml
  540. 539 cd /tmp/
  541. 540 ls
  542. 541 cd ansible1.example.com/tmp/
  543. 542 ls
  544. 543 cat hosts
  545. 544 cd -
  546. 545 cd
  547. 546 cd rhce8-live/lesson9/
  548. 547 vim selinux.yml
  549. 548 ansible-playbook selinux.yml
  550. 549 dnf provides */semanage
  551. 550 vim selinux.yml
  552. 551 ansible-playbook selinux.yml
  553. 552 ansible all -a "ls -lZ /tmp/removeme"
  554. 553 ls
  555. 554 vim templates/vsftpd.j2
  556. 555 vim vsftpd-template.yml
  557. 556 ls
  558. 557 vim vsftpd-template.yml
  559. 558 ansible-playbook vsftpd-template.yml
  560. 559 ansible all -m setup
  561. 560 ansible-playbook vsftpd-template.yml
  562. 561 vim templates/vsftpd.j2
  563. 562 vim vsftpd-template.yml
  564. 563 ansible-playbook vsftpd-template.yml
  565. 564 ansible all -a "cat /etc/vsftpd/vsftpd.conf"
  566. 565 cat templates/vsftpd.j2
  567. 566 ../countdown 12
  568. 567 vim templates/hosts.j2
  569. 568 ls
  570. 569 vim hostsfile.yml
  571. 570 ansible-playbook hostsfile.yml
  572. 571 ansible all -a "cat /etc/hosts"
  573. 572 ansible-galaxy install geerlingguy.nginx
  574. 573 cd /home/ansible/.ansible/roles/geerlingguy.nginx
  575. 574 ls
  576. 575 cd templates/
  577. 576 ls
  578. 577 cd ../tasks/
  579. 578 ls
  580. 579 vim main.yml
  581. 580 vim setup-RedHat.yml
  582. 581 cd -
  583. 582 cd ~/rhce8-live/lesson11/
  584. 583 ls
  585. 584 vim nginx-role.yml
  586. 585 ansible-playbook nginx-role.yml
  587. 586 vim nginx-role.yml
  588. 587 ansible-playbook nginx-role.yml
  589. 588 ls
  590. 589 vim apache-vhost-role.yml
  591. 590 ansible-playbook apache-vhost-role.yml
  592. 591 cd roles/
  593. 592 ls
  594. 593 cd mywebhost/
  595. 594 ls
  596. 595 tree
  597. 596 vim tasks/main.yml
  598. 597 cd ../motd/
  599. 598 tree
  600. 599 vaim tasks/main.yml
  601. 600 vim tasks/main.yml
  602. 601 vim templates/motd.j2
  603. 602 ls
  604. 603 vim defaults/main.yml
  605. 604 cd ..
  606. 605 tree
  607. 606 cd ..
  608. 607 vim motd-role.yml
  609. 608 ansible-playbook motd-role.yml
  610. 609 ansible all -a "cat /etc/hosts"
  611. 610 ansible all -a "cat /etc/motd"
  612. 611 cat roles/motd/templates/motd.j2
  613. 612 ansible-playbook motd-role.yml -e system_manager=bob
  614. 613 ansible all -a "cat /etc/motd"
  615. 614 ls
  616. 615 cd roles/
  617. 616 ls
  618. 617 vim requirements.yml
  619. 618 sudo dnf search system-roles
  620. 619 sudo dnf install rhel-system-roles
  621. 620 rpm -qd rhel-system-roles
  622. 621 cd /usr/share/doc/rhel-system-roles/
  623. 622 ls
  624. 623 cd selinux/
  625. 624 ls
  626. 625 pwd
  627. 626 cp example-selinux-playbook.yml ~/rhce8-live/lesson11/
  628. 627 vim example-selinux-playbook.yml
  629. 628 ls -l example-selinux-playbook.yml
  630. 629 sudo chown ansible:ansible example-selinux-playbook.yml
  631. 630 vim example-selinux-playbook.yml
  632. 631 ansible-playbook example-selinux-playbook.yml
  633. 632 vim example-selinux-playbook.yml
  634. 633 pwd
  635. 634 cp example-selinux-playbook.yml ~/rhce8-live/lesson11/
  636. 635 cd ~/rhce8-live/lesson11/
  637. 636 ansible-playbook example-selinux-playbook.yml
  638. 637 ansible all -a "ls -Zd /web"
  639. 638 history
  640. 639 cat inventory
  641. 640 ansible all -m setup
  642. 641 cd ../lesson8/
  643. 642 ansible all -m setup
  644. 643 cd -
  645. 644 ansible localhost -m debug -a "msg={{ 'mypassword' | password_hash('sha512', 'mysecretsalt') }}"
  646. 645 cd ../lesson16/
  647. 646 vim userpw.yaml
  648. 647 ansible-playbook userpw.yaml
  649. 648 vim userpw.yaml
  650. 649 ansible-playbook userpw.y
  651. 650 ansible-playbook userpw.yaml
  652. 651 ansible all -a "tail -1 /etc/shadow"
  653. 652 ansible all -a "tail /etc/shadow"
  654. 653 ansible all -m user -a "name=bob state=absent"
  655. 654 tail /etc/shadow
  656. 655 ansible localhost -a "tail /etc/shadow"
  657. 656 cat userpw.yaml
  658. 657 vim userpw.yaml
  659. 658 vim userpw.yml
  660. 659 ls
  661. 660 vim listing1313.yaml
  662. 661 vim users-advanced.yml
  663. 662 vim exercise134-tasks.yaml
  664. 663 vim exercise134-vars.yaml
  665. 664 vim users-advanced.yml
  666. 665 ansible-playbook --help | grep tags
  667. 666 ansible-playbook --list-tags users-advanced.yml
  668. 667 ansible-playbook users-advanced.yml
  669. 668 ls
  670. 669 ssh blair@ansible2
  671. 670 ls blair/
  672. 671 su - blair
  673. 672 vim users-advanced.yml
  674. 673 pwd
  675. 674 cd ../..
  676. 675 ls
  677. 676 cd ansibleinthreeweeks/
  678. 677 cd docker/
  679. 678 ls
  680. 679 cat newdocker.yaml
  681. 680 vim newdocker.yaml
  682. 681 cd -
  683. 682 cd ../rhce8-live/lesson16/
  684. 683 vim storage-phase1.yaml
  685. 684 ansible-playbook storage-phase1.yaml
  686. 685 vim storage-phase1.yaml
  687. 686 ansible-playbook storage-phase1.yaml
  688. 687 vim inventory
  689. 688 ansible-playbook storage-phase1.yaml
  690. 689 ../countdown 25
  691. 690 vim wk.yaml
  692. 691 cd ../lesson13/
  693. 692 ls
  694. 693 vim imports.yaml
  695. 694 vim install-and-setup.yml
  696. 695 vim includes-and-imports.yaml
  697. 696 ls
  698. 697 cd ../lesson15/
  699. 698 ls
  700. 699 vim assertsize-wrong.yml
  701. 700 ansible-playbook assertsize-wrong.yml
  702. 701 vim assertsize.yml
  703. 702 ansible-playbook assertsize.yml
  704. 703 ls
  705. 704 vim assertnic.yml
  706. 705 ansible-playbook assertnic.yml
  707. 706 vim assertnic.yml
  708. 707 ansible-playbook assertnic.yml
  709. 708 ip a
  710. 709 vim assertnic.yml
  711. 710 ansible-playbook assertnic.yml
  712. 711 vim uri.yml
  713. 712 ansible-playbook uri.yml
  714. 713 ../countdown 25
  715. 714 cd ../lesson16/
  716. 715 vim dg.yaml
  717. 716 cat dg.yaml
  718. 717 vim dg.yaml
  719. 718 vim wk3.yaml
  720. 719 ansible-playbook wk3.yaml
  721. 720 vim wk3.yaml
  722. 721 ansible-playbook wk3.yaml
  723. 722 ansible ansible2.example.com -a "cat /etc/fstab"
  724. 723 ansible ansible2.example.com -a "lsblk"
  725. 724 ../countdown 10
  726. 725 ls
  727. 726 vim storage-advanced.yml
  728. 727 ansible-doc yum_repository
  729. 728 ls
  730. 729 vim software-advanced.yml
  731. 730 vim setup_repo_client.yml
  732. 731 vim smalldemo.yaml
  733. 732 ansible-playbook smalldemo.yaml
  734. 733 vim smalldemo.yaml
  735. 734 ansible-playbook smalldemo.yaml
  736. 735 vim smalldemo.yaml
  737. 736 cat smalldemo.yaml
  738. 737 history
  739. [ansible@control lesson16]$ cat smalldemo.yaml
  740. ---
  741. - name: make command idempotent
  742. hosts: ansible2.example.com
  743. gather_facts: no
  744. tasks:
  745. - name: find out if anna already exists
  746. shell: id anna
  747. register: isanna
  748. - debug:
  749. var: isanna
  750. - name: create user anna
  751. command: useradd anna
  752. when: isanna.rc != 0
  753.  
Advertisement
Add Comment
Please, Sign In to add comment