sandervanvugt

ansible3weeks last day Oct21

Oct 25th, 2021
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.45 KB | None | 0 0
  1. ####ON KVM HOST
  2. 88 cat ansible.cfg
  3. 89 vim create-vms.yaml
  4. 90 vim host_vars/localhost
  5. 91 vim templates/vm-template.xml.j2
  6. 92 vim create-vms.yaml
  7. 93 sudo virsh list
  8. 94 ansible-playbook create-vms.yaml
  9. 95 sudo virsh list
  10. 96 sudo virsh list all
  11. 97 sudo virsh list --all
  12. 98 ls
  13. 99 sudo yum repolist
  14. 100 sudo yum install epel-release
  15. 101 sudo yum search epel
  16. 102 sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
  17. 103 sudo yum install python3-paramiko
  18. 104 ansible-doc -l | grep ios
  19. 105 ansible-doc ios_interfaces
  20. 106 ansible-doc -l | grep ^ios | less
  21. 107 exit
  22. 108 cd cisco/
  23. 109 ls
  24. 110 ansible --version
  25. 111 vim inventory
  26. 112 ls
  27. 113 ansible -m debug -a "var=ansible_user" switches
  28. 114 vim inventory
  29. 115 vim ansible.cfg
  30. 116 ansible -m debug -a "var=ansible_user" switches
  31. 117 mkdir group_vars
  32. 118 vim group_vars/switches
  33. 119 ansible -m debug -a "var=ansible_user" switches
  34. 120 ls
  35. 121 ansible all -m ios_ping -a "dest=192.168.50.1"
  36. 122 pip3 install paramiko
  37. 123 sudo pip3 install paramiko
  38. 124 sudo dnf upgrade -y
  39. 125 ansible all -m ios_ping -a "dest=192.168.50.1"
  40. 128 ansible all -m ios_ping -a "dest=192.168.50.1"
  41. 129 ansible -m ios_command -a "commands='traceroute 8.8.8.8 probe 2 timeout 2'" all
  42. 130 ansible all -m ios_facts
  43. 131 ansible all -m ios_interfaces -a "state"
  44. 132 ansible all -m ios_interfaces
  45. 133 vim iosbackup.yml
  46. 134 ansible-playbook iosbackup.yml
  47. 135 cat iosbackup.yml
  48. 136 vim inventory
  49. 137 cd group_vars/
  50. 138 cat switches
  51. 139 history | grep pip
  52. 140 exit
  53. 141 history | grep pip
  54. 142 cd cisco/
  55. 143 cat ansible.cfg
  56. 144 sudo vim /etc/ansible/hosts
  57. 145 su - student
  58. 146 su - sander
  59. 147 free -m
  60. 148 cd provision-kvm/
  61. 149 ls
  62. 150 vim ansible.cfg
  63. 151 cat host_vars/localhost
  64. 152 vim host_vars/localhost
  65. 153 ls templates/
  66. 154 cat vm-t
  67. 155 cat vm-template.xml.j2
  68. 156 cat templates/vm-template.xml.j2
  69. 157 s
  70. 158 ls
  71. 159 vim create-vms.yaml
  72. 160 ansible-playbook create-vms.yaml
  73. 161 ls
  74. 162 cd cisco/
  75. 163 ls
  76. 164 cd cisco/
  77. 165 ls
  78. 166 vim inventory
  79. 167 ansible switches -m ping -u admin -k -i inventory
  80. 168 sudo dnf install python-paramiko
  81. 169 sudo subscription-manager status
  82. 170 yum repolist
  83. 171 sudo yum repolist
  84. 172 sudo yum install python-paramiko
  85. 173 ansible all -i switches -c network_cli -u admin -k -m ios_facts -e ansible_network_os=ios
  86. 174 ansible all -i inventory -c network_cli -u admin -k -m ios_facts -e ansible_network_os=ios
  87. 175 vim ansible.cfg
  88. 176 vim inventory
  89. 177 ansible all -i inventory -m ios_facts -e ansible_network_os=ios
  90. 178 find / -name "paramiko*"
  91. 179 sudo find / -name "paramiko*" 2>/dev/null
  92. 180 cd /usr/lib/python3.6/site-packages/ansible/plugins/connection/
  93. 181 vim paramiko_ssh.py
  94. 183 exit
  95. 184 ls
  96. 185 cd cisco/
  97. 186 ls
  98. 187 vim inventory
  99. 188 cd group_vars/
  100. 189 ls
  101. 190 vim switches
  102. 191 cd ..
  103. 192 vim ansible.cfg
  104. 193 ansible-doc -l | grep ios | less
  105. 194 ansible-doc -l | grep ^ios | less
  106. 195 pwd
  107. 197 ansible 192.168.50.69 -m ping -u admin -k -i inventory
  108. 198 sudo pip3 install paramiko
  109. 199 ls
  110. 200 vim iosbackup.yml
  111. 201 vim inventory
  112. 202 vim iosbackup.yml
  113. 203 ansible-doc ios-config
  114. 204 vim iosbackup.yml
  115. 205 ansible-doc ios_config
  116. 206 ls
  117. 207 ls -l backup/
  118. 208 ls
  119. 209 ansible-playbook iosbackup.yml
  120. 210 history | grep backup
  121. 212 ansible-playbook iosbackup.yml -u admin -k
  122. 213 ls backup/
  123. 214 cd ..
  124. 215 ls
  125. 216 cd provision-kvm
  126. 217 ls
  127. 218 cat ansible.cfg
  128. 219 cat host_vars/
  129. 220 cat host_vars/localhost
  130. 221 vim host_vars/localhost
  131. 222 sudo df -h
  132. 223 free -m
  133. 224 ls
  134. 225 cd templates/
  135. 226 ls -l
  136. 227 vim vm-template.xml.j2
  137. 228 cd ..
  138. 229 vim create-vms.yaml
  139. 230 cat host_vars/localhost
  140. 231 vim create-vms.yaml
  141. 232 ansible-playbook create-vms.yaml
  142. 233 history
  143.  
  144.  
  145. #####On Rocky[ansible@controller docker]$ history
  146. 1 ip a
  147. 2 sudo vim /etc/hosts
  148. 3 cat /etc/hosts
  149. 4 sudo vim /etc/hosts
  150. 5 sudo dnf install epel-release
  151. 6 sudo dnf install -y ansible
  152. 7 ansible --version
  153. 8 vim /etc/hosts
  154. 9 mkdir projectone
  155. 10 cd projectone/
  156. 11 vim inventory
  157. 12 ansible -i inventory -m command -a "ip a"
  158. 13 ansible all -i inventory -m command -a "ip a"
  159. 14 cat /etc/hosts
  160. 15 sudo sh -c "echo password | passwd --stdin ansible"
  161. 16 echo ansible ALL=(ALL) NOPASSWD: ALL > /tmp/sudoers
  162. 17 echo 'ansible ALL=(ALL) NOPASSWD: ALL' > /tmp/sudoers
  163. 18 ansible all -i inventory -u root -k -m raw -a "useradd -G wheel ansible"
  164. 19 sudo vim /etc/ansible/ansible.cfg
  165. 20 ansible all -i inventory -u root -k -m raw -a "useradd -G wheel ansible"
  166. 21 ansible all -i inventory -u root -k -m raw -a "useradd -G wheel bob"
  167. 22 ansible all -i inventory -u root -k -m raw -a "userdel bob"
  168. 23 sudo cp /tmp/sudoers /etc/sudoers.d/ansible
  169. 24 sudo ls /root
  170. 25 su - ansible
  171. 26 ssh-keygen
  172. 27 ssh-copy-id ubuntu
  173. 28 ssh-copy-id centos7
  174. 29 ssh-copy-id rhel84
  175. 30 ansible all -i inventory -u root -k -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  176. 31 ls
  177. 32 cd projectone/
  178. 33 ansible all -i inventory -u root -k -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  179. 34 ansible all -i inventory -u ansible -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  180. 35 cd ..
  181. 36 sudo dnf install git -y
  182. 37 git clone https://github.com/sandervanvugt/ansiblein3weeks
  183. 38 git clone https://github.com/sandervanvugt/ansible3weeks
  184. 39 git clone https://github.com/sandervanvugt/ansibleinthreeweeks
  185. 40 cd ansibleinthreeweeks/
  186. 41 ls
  187. 42 cd ..
  188. 43 git clone https://github.com/sandervanvugt/luth
  189. 44 luth/countdown 15
  190. 45 ansible ubuntu -i inventory -u ansible -k -K -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  191. 46 cd projectone/
  192. 47 ansible ubuntu -i inventory -u ansible -k -K -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  193. 48 ansible ubuntu -i inventory -u ansible -k -K -m command -a "ls -ld /etc/sudoers.d"
  194. 49 ansible ubuntu -i inventory -u ansible -k -K -m command -a "ls -la /root"
  195. 50 vim inventory
  196. 51 cat /etc/ansible/hosts
  197. 52 less /etc/ansible/ansible.cfg
  198. 53 cd ../ansibleinthreeweeks/
  199. 54 ls
  200. 55 cd basics/
  201. 56 ls
  202. 57 cd ..
  203. 58 find . -name "ansible.cfg"
  204. 59 vim ansible.cfg
  205. 60 cp ansible.cfg ../projectone/
  206. 61 cd ../projectone/
  207. 62 ls
  208. 63 vim inventory
  209. 64 cd -
  210. 65 cd collections/
  211. 66 ls
  212. 67 vim ansible.cfg
  213. 68 ansible-doc -l
  214. 69 ansible-doc -l | wc
  215. 70 cd ../../projectone/
  216. 71 history
  217. 72 ansible ubuntu -i inventory -u ansible -b -k -K -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  218. 73 cat ansible.cfg
  219. 74 ansible -m package -a "name=nmap"
  220. 75 ansible ubuntu -m package -a "name=nmap"
  221. 76 ansible-doc package
  222. 77 ansible all -m command -a "useradd -m -s /bin/bash linda"
  223. 78 vim inventory
  224. 79 ansible all -m command -a "id linda"
  225. 80 ansible all -m command -a "useradd -m -s /bin/bash linda"
  226. 81 ansible all -m user -a "name=linda"
  227. 82 ../luth/countdown 12
  228. 83 sudo vim /etc/hosts
  229. 84 cd ../ansibleinthreeweeks/
  230. 85 ls
  231. 86 cd collections/
  232. 87 ls
  233. 88 vim enforce-selinux.yml
  234. 89 cd ../../projectone/
  235. 90 ansible all -m ping
  236. 91 ansible all -m user -a "name=lisa"
  237. 92 ansible all -m command -a "id lisa"
  238. 93 ansible all -m user -a "name=lisa state=absent"
  239. 94 ansible all -m command -a "id lisa"
  240. 95 ansible centos7 -m command -a "rpm -qa | grep python"
  241. 96 ansible centos7 -m shell -a "rpm -qa | grep python"
  242. 97 ansible all -m copy -a 'content="hello world" dest=/etc/motd'
  243. 98 ansible all -m command -a "cat /etc/motd"
  244. 99 ansible all -m package -a "name=nmap state=latest"
  245. 100 ansible all -m service -a "name=httpd state=started"
  246. 101 cd ../ansibleinthreeweeks/
  247. 102 ls
  248. 103 cd basics/
  249. 104 ls
  250. 105 cp ../../projectone/* .
  251. 106 ls
  252. 107 vim install_and_start_httpt.yaml
  253. 108 ansible-doc service
  254. 109 ls
  255. 110 ansible-playbook install_and_start_httpt.yaml
  256. 111 cd ..
  257. 112 ../luth/countdown 25
  258. 113 vim kp.yaml
  259. 114 ansible-doc service
  260. 115 vim kp.yaml
  261. 116 ansible-doc firewalld
  262. 117 vim kp.yaml
  263. 118 ansible-playbook kp.yaml
  264. 119 cd ../projectone/
  265. 120 ansible-playbook ../ansibleinthreeweeks/kp.yaml
  266. 121 cd ../ansibleinthreeweeks/basics/
  267. 122 ls
  268. 123 vim multi_play.yaml
  269. 124 cp ../../projectone/inventory .
  270. 125 ansible-playbook multi_play.yaml
  271. 126 vim multi_play.yaml
  272. 127 ansible-doc yum
  273. 128 vim multi_play.yaml
  274. 129 ansible-doc yum
  275. 130 ansible-playbook multi_play.yaml
  276. 131 cd ../..
  277. 132 git clone https://github.com/sandervanvugt/rhce8-live
  278. 133 cd rhce8-live/
  279. 134 ls
  280. 135 cd lesson16/
  281. 136 ls
  282. 137 vim software-advanced.yml
  283. 138 vim setup-rhel.yml
  284. 139 grep prompt *
  285. 140 cd ..
  286. 141 grep -r prompt *
  287. 142 cat lesson15/assertsize.yml
  288. 143 cd lesson16/
  289. 144 ls
  290. 145 vim setup-rhel.yml
  291. 146 ansible-playbook setup-rhel.yml
  292. 147 vim inventory
  293. 148 ansible-playbook setup-rhel.yml
  294. 149 vim setup-rhel.yml
  295. 150 cp setup-rhel.yml ~/ansibleinthreeweeks/
  296. 151 cd ~/ansibleinthreeweeks/
  297. 152 ls
  298. 153 cd basics/
  299. 154 ls
  300. 155 ansible-playbook playbook_with_errors.yaml
  301. 156 vim playbook_with_errors.yaml
  302. 157 ansible-playbook playbook_with_errors.yaml
  303. 158 vim playbook_with_errors.yaml
  304. 159 ansible-playbook playbook_with_errors.yaml
  305. 160 vim playbook_with_errors.yaml
  306. 161 ansible-playbook playbook_with_errors.yaml
  307. 162 vim playbook_with_errors.yaml
  308. 163 pwd
  309. 164 ../../luth/countdown 12
  310. 165 cd ..
  311. 166 cd basics/
  312. 167 vim inventory
  313. 168 ansible rhel84 -a "yum repolist"
  314. 169 ls
  315. 170 vim variables_example.yaml
  316. 171 ansible-playbook variables_example.yaml
  317. 172 ansible-playbook variables_example.yaml -e user=bob
  318. 173 vim variables_example.yaml
  319. 174 ansible rhel84 -m setup > rhelfacts.txt
  320. 175 less rhelfacts.txt
  321. 176 ansible-doc -l | grep fact
  322. 177 ansible-doc -l | grep _fact
  323. 178 vim gather_facts.yaml
  324. 179 less rhelfacts.txt
  325. 180 ansible-playbook gather_facts.yaml
  326. 181 ls
  327. 182 vim old_facts.yaml
  328. 183 ansible-playbook old_facts.yaml
  329. 184 vim new_facts.yaml
  330. 185 ansible-playbook new_facts.yaml
  331. 186 vim new_facts.yaml
  332. 187 vim myvars.yaml
  333. 188 vim vars_file.yaml
  334. 189 ansible-playbook vars_file.yaml
  335. 190 ls
  336. 191 cp vars_file.yaml vars_host.yaml
  337. 192 mkdir host_vars
  338. 193 vim vars_host.yaml
  339. 194 vim host_vars/centos7
  340. 195 ansible-playbook vars_host.yaml
  341. 196 vim host_vars/centos7
  342. 197 ansible-playbook vars_host.yaml
  343. 198 cd ../
  344. 199 cd ../rhce8-live/lesson5/
  345. 200 ls
  346. 201 cd webservers/
  347. 202 ls
  348. 203 cat group_vars/lamp
  349. 204 vim site.yml
  350. 205 cd ../..
  351. 206 pwd
  352. 207 cd ../ansibleinthreeweeks/
  353. 208 cd basics/
  354. 209 ls
  355. 210 vim host_vars/centos7
  356. 211 ansible-playbook vars_host.yaml
  357. 212 cd ../..
  358. 213 cd rhce8-live/lesson16/
  359. 214 ls
  360. 215 vim software-advanced.yml
  361. 216 cd
  362. 217 history
  363. 218 sudo poweroff
  364. 219 sudo vim /etc/hosts
  365. 220 ip a
  366. 221 sudo vim /etc/hosts
  367. 222 cd ansibleinthreeweeks/
  368. 223 vim inventory
  369. 224 cd basics/
  370. 225 vim inventory
  371. 226 cp inventory ..
  372. 227 ansible all -m copy -a "src=/etc/hosts dest=/etc/hosts"
  373. 228 ssh-copy-id tower
  374. 229 exit
  375. 230 ansible all -m copy -a "src=/etc/hosts dest=/etc/hosts"
  376. 231 cd ansibleinthreeweeks/basics/
  377. 232 vim ansible.cfg
  378. 233 ansible tower -m copy -a "src=/etc/hosts dest=/etc/hosts"
  379. 234 exit
  380. 235 history
  381. 236 cd ansibleinthreeweeks/
  382. 237 ls
  383. 238 find . -name "create-users.yml"
  384. 239 cd ..
  385. 240 find . -name "create-users.yml"
  386. 241 ls
  387. 242 find . -name "create-users.*"
  388. 243 cd rhce8-live/
  389. 244 ls
  390. 245 cd lesson5/
  391. 246 ls
  392. 247 cd ../lesson7/
  393. 248 ls
  394. 249 cd vault/
  395. 250 ls
  396. 251 cd ../..
  397. 252 cd ../ansibleinthreeweeks/
  398. 253 find . -name "create-user.*"
  399. 254 ls
  400. 255 ansible-vault create secret.yml
  401. 256 ansible-vault edit secret.yml
  402. 257 vim create-user.yml
  403. 258 ansible-playbook create-user.yml
  404. 259 ansible-playbook --ask-vault-pass create-user.yml
  405. 260 echo password > vault-pass
  406. 261 ansible-playbook --vault-password-file=vault-pass create-user.yml
  407. 262 vim /etc/ansible/ansible.cfg
  408. 263 ls
  409. 264 cd templates/
  410. 265 ls
  411. 266 vim vsftpd-template.yml
  412. 267 vim vsftpd.j2
  413. 268 ansible-playbook vsftpd-template.yml
  414. 269 cp ../basics/inventory .
  415. 270 cat inventory
  416. 271 ansible-playbook vsftpd-template.yml
  417. 272 ls
  418. 273 cp ../basics/ansible.cfg .
  419. 274 cat ansible.cfg
  420. 275 ansible-playbook vsftpd-template.yml
  421. 276 vim vsftpd-template.yml
  422. 277 pwd
  423. 278 ansible rhel84 -m command -a "cat /etc/vsftpd/vsftpd.conf"
  424. 279 cd ..
  425. 280 ls
  426. 281 cd task_control/
  427. 282 ls
  428. 283 vim handlers.yml
  429. 284 echo hello world > /tmp/index.html
  430. 285 cp ../basics/inventory .
  431. 286 ansible-playbook handlers.yml
  432. 287 cp ../basics/ansible.cfg .
  433. 288 ansible-playbook handlers.yml
  434. 289 vim handlers.yml
  435. 290 ansible-playbook handlers.yml
  436. 291 ansible all -m file -a "name=/tmp/index.html state=absent"
  437. 292 ansible all -m file -a "name=/var/www/html/index.html state=absent"
  438. 293 ansible-playbook handlers.yml
  439. 294 cd ..
  440. 295 ls
  441. 296 luth/countdown 13
  442. 297 ip a
  443. 298 cd ansibleinthreeweeks/
  444. 299 ls
  445. 300 cd task_control/
  446. 301 ls
  447. 302 vim loopservices.yml
  448. 303 ansible-playbook loopservices.yml
  449. 304 vim inventory
  450. 305 ansible-playbook loopservices.yml
  451. 306 vim loopservices.yml
  452. 307 ansible-playbook loopservices.yml
  453. 308 ~/luth/countdown 12
  454. 309 ls
  455. 310 vim ifsize.yml
  456. 311 ansible-playbook ifsize.yml
  457. 312 vim ifsize.yml
  458. 313 ansible-playbook ifsize.yml
  459. 314 lw
  460. 315 ls
  461. 316 vim when_multiple.yml
  462. 317 vim ifsize.yml
  463. 318 vim when_multiple.yml
  464. 319 ansible-playbook when_multiple.yml
  465. 320 cd ..
  466. 321 ls
  467. 322 cd roles
  468. 323 ls
  469. 324 cd ..
  470. 325 cd roles
  471. 326 ansible-galaxy install geerlingguy.nginx
  472. 327 cd ~/.ansible/roles/geerlingguy.nginx/
  473. 328 tree
  474. 329 vim tasks/main.yml
  475. 330 vim tasks/setup-RedHat.yml
  476. 331 cd ..
  477. 332 pwd
  478. 333 cd ~/ansibleinthreeweeks/roles/
  479. 334 ls
  480. 335 vim nginx-role.yml
  481. 336 ansible-playbook nginx-role.yml
  482. 337 cp ../basics/ansible.cfg .
  483. 338 cp ../basics/inventory .
  484. 339 ansible-playbook nginx-role.yml
  485. 340 pwd
  486. 341 cd
  487. 342 luth/countdown 20
  488. 343 ls
  489. 344 git clone https://github.com/sandervanvugt/rhce8-book
  490. 345 cd rhce8-book/
  491. 346 grep tag *
  492. 347 vim exercise123.yaml
  493. 348 ansible-playbook --list-tags exercise123.yaml
  494. 349 vim exercise123.yaml
  495. 350 ansible-playbook --list-tags exercise123.yaml -e newhost=tower -e newhostip=192.168.29.20
  496. 351 ansible-playbook --prompt-vault-pass --list-tags exercise123.yaml -e newhost=tower -e newhostip=192.168.29.20
  497. 352 ansible-playbook --ask-vault-pass --list-tags exercise123.yaml -e newhost=tower -e newhostip=192.168.29.20
  498. 353 vim exercise123.yaml
  499. 354 ansible-playbook exercise123.yaml --tags add-host -e newhost=tower -e newhostip=192.168.29.20
  500. 355 vim exercise123.yaml
  501. 356 ansible-playbook exercise123.yaml --tags addhost -e newhost=tower -e newhostip=192.168.29.20
  502. 357 ansible tower -m setup
  503. 358 grep vgs *
  504. 359 vim exercise153.yaml
  505. 360 cd ../ansibleinthreeweeks/
  506. 361 find . -name "sync*"
  507. 362 vim synchronize.yaml
  508. 363 ansible all -m command -a "grep requiretty /etc/sudoers"
  509. 364 ansible all -m command -a "grep wheel /etc/sudoers"
  510. 365 ansible-doc -t callback -l
  511. 366 ansible-doc -t callback yamlize
  512. 367 ansible-doc -t callback -l
  513. 368 ansible-doc -t callback yaml
  514. 369 ls
  515. 370 cd plugins/
  516. 371 ls
  517. 372 vim ansible.cfg
  518. 373 sudo cgcreate -a ansible:ansible -t ansible:ansible -g cpuacct,memory,pid:ansible_profile
  519. 374 sudo yum provides */cgcreate
  520. 375 sudo yum install libcgroup-tools
  521. 376 sudo cgcreate -a ansible:ansible -t ansible:ansible -g cpuacct,memory,pid:ansible_profile
  522. 377 pwd
  523. 378 ../../luth/countdown 12
  524. 379 sudo vim /etc/default/grub
  525. 380 sudo grub2-mkconfig -o /boot/grub2/grub.cfg
  526. 381 sudo reboot
  527. 382 luth/countdown 5
  528. 383 sudo cgcreate -a ansible:ansible -t ansible:ansible -g cpuacct,memory,pid:ansible_profile
  529. 384 mount | grep cgroup
  530. 385 sudo cgcreate -a ansible:ansible -t ansible:ansible -g cpuacct,memory,pids:ansible_profile
  531. 386 #cgexec -g cpuacct,memory,pids:ansible_profile ansible_playbook
  532. 387 cd ansibleinthreeweeks/
  533. 388 ls
  534. 389 cd plugins/
  535. 390 ls
  536. 391 cgexec -g cpuacct,memory,pids:ansible_profile ansible_playbook hello.yml
  537. 392 vim ansible.cfg
  538. 393 ansible-playbook hello.yml
  539. 394 cd ..
  540. 395 cd filters/
  541. 396 ls
  542. 397 vim int-filter.yaml
  543. 398 ansible-playbook int-filter.yaml
  544. 399 vim int-filter.yaml
  545. 400 ansible-playbook int-filter.yaml
  546. 401 vim int-filter.yaml
  547. 402 ansible-playbook int-filter.yaml
  548. 403 ls -l /tmp
  549. 404 vim storage-filter.yaml
  550. 405 vim assert_filter.yaml
  551. 406 ansible-playbook assert_filter.yaml
  552. 407 vim assert_filter.yaml
  553. 408 ansible-playbook assert_filter.yaml
  554. 409 vim assert_filter.yaml
  555. 410 vim password_hash.yaml
  556. 411 sudo cat /etc/shadow
  557. 412 vim password_hash.yaml
  558. 413 cp password_hash.yaml passdumb.yaml
  559. 414 vim passdumb.yaml
  560. 415 ansible-playbook passdumb.yaml -e user=lisa
  561. 416 cp ../basics/inventory .
  562. 417 cp ../basics/ansible.cfg .
  563. 418 ansible-playbook passdumb.yaml -e user=lisa
  564. 419 ansible rhel84 -a "cat /etc/shadow"
  565. 420 vim password_hash.yaml
  566. 421 ansible-playbook password_hash.yaml
  567. 422 ansible rhel84 -a "cat /etc/shadow"
  568. 423 history
  569. 424 cat passdumb.yaml
  570. 425 sudo poweroff
  571. 426 sudo reboot
  572. 427 ../luth/countdown 13
  573. 428 cd windows/
  574. 429 ls
  575. 430 cat pw.yaml
  576. 431 ansible-vault edit pw.yaml
  577. 432 vim createad.yml
  578. 433 ansible-playbook --ask-vault-pass createad.yml
  579. 434 ansible-doc virt
  580. 435 ansible-doc -l | grep virt
  581. 436 ansible-doc -l | grep libvirt
  582. 437 ansible-doc -l | grep virt
  583. 438 ansible-doc -l | grep vsphere
  584. 439 exit
  585. 440 ip a
  586. 441 ../luth/countdown 22
  587. 442 exit
  588. 443 ip a
  589. 444 sudo vim /etc/hosts
  590. 445 cd ansibleinthreeweeks/windows/
  591. 446 cat inventory
  592. 447 ls
  593. 448 cd ..
  594. 449 git pull\
  595. 450 git pull
  596. 451 cd windows/
  597. 452 ls
  598. 453 cat ansible.cfg
  599. 454 cat inventory
  600. 455 sudo vim /etc/hosts
  601. 456 sudo pip3 install pywinrm
  602. 457 ansible win -m win_ping
  603. 458 ansible-doc -l | grep '^win' | less
  604. 459 ansible win -m setup | less
  605. 460 vim playbook.yml
  606. 461 ansible-playbook playbook.yml
  607. 462 ls
  608. 463 vim createad.yml
  609. 464 ansible-playbook createad.yml
  610. 465 cat createad.yml
  611. 466 ls
  612. 467 vim createad.yml
  613. 468 ansible-vault --help
  614. 469 ansible-vault create vault/pw.yaml
  615. 470 mkdir vault
  616. 471 ls -l
  617. 472 ansible-playbook --ask-vault-pass createad.yml
  618. 473 cat createad.yml
  619. 474 vim createad.yml
  620. 475 vim ../create-user.yml
  621. 476 ls
  622. 477 vim createad.yml
  623. 478 ansible-playbook --ask-vault-pass createad.yml
  624. 479 vim vault/pw.yaml
  625. 480 ansible-vault edit pw.yaml
  626. 481 ansible-vault edit vault/pw.yaml
  627. 482 vim ../vault-pass
  628. 483 cd ..
  629. 484 cat create-user.yml
  630. 485 ls
  631. 486 ansible-vault secret.yml
  632. 487 ansible-vault edit secret.yml
  633. 488 cd windows/vault/
  634. 489 ansible-vault edit pw.yaml
  635. 490 vim ../createad.yml
  636. 491 cd ..
  637. 492 vim createad.yml
  638. 493 ansible-playbook --ask-vault-pass createad.yml
  639. 494 ls
  640. 495 cp vault/pw.yaml .
  641. 496 ansible-playbook --ask-vault-pass createad.yml
  642. 497 vim createad.yml
  643. 498 ls -l
  644. 499 ansible-playbook --ask-vault-pass createad.yml
  645. 500 cd ..
  646. 501 ansible-doc -l | grep docker
  647. 502 ls
  648. 503 vim docker_main.yaml
  649. 504 vim docker-ubuntu.yaml
  650. 505 vim docker-centos.yaml
  651. 506 ansible-playbook docker_main.yaml
  652. 507 ansible ubuntu -a "ip a"
  653. 508 ssh ubuntu
  654. 509 vim docker-ubuntu.yaml
  655. 510 ssh ubuntu
  656. 511 vim docker-ubuntu.yaml
  657. 512 ansible-playbook docker_main.yaml
  658. 513 cim docker.yaml
  659. 514 vim docker.yaml
  660. 515 ansible-doc -l | grep ios
  661. 517 exit
  662. 518 cd ..
  663. 519 ls
  664. 520 ../luth/countdown 13
  665. 521 exit
  666. 522 sudo vim /etc/ansible/ansible.cfg
  667. 523 cd ansibleinthreeweeks/windows/
  668. 524 ansible-inventory --yaml -i inventory --list --output inventory.yaml
  669. 525 vim inventory.yaml
  670. 526 cd
  671. 527 sudo pip3 install bot bot3
  672. 528 sudo pip3 install boto boto3
  673. 529 python3
  674. 530 cd ansibleinthreeweeks/ec2/
  675. 531 ls
  676. 532 tree
  677. 533 ls
  678. 534 ls -l
  679. 535 vim list-instances.yml
  680. 536 ansible-playbook list-instances.yml
  681. 537 ansible-playbook --ask-vault-pass list-instances.yml
  682. 538 ls
  683. 539 vim ubuntu-new.yaml
  684. 540 ansible-playbook ubuntu-new.yaml --ask-vault-pass
  685. 541 ansible-playbook --ask-vault-pass list-instances.yml
  686. 542 ls
  687. 543 cd
  688. 544 dnf provides */aws
  689. 545 sudo dnf install awscli
  690. 546 aws ec2 describe-instances --region us-west-2
  691. 547 ansible localhost -m ec2 -a 'instance_id=i-06d5f79ba626dd2b2 state=absent region=us-west-2'
  692. 548 ansible localhost -m ec2 -a 'instance_id=i-06d5f79ba626dd2b2 state=absent region=us-west-2' -e aws_access_key=$aws_access_key -e aws_secret_key=$aws_secret_key
  693. 549 luth/countdown 12
  694. 550 cd ansibleinthreeweeks/
  695. 551 cd docker/
  696. 552 ls
  697. 553 cp ../ansible.cfg .
  698. 554 cp ../inventory .
  699. 555 vim newdocker.yaml
  700. 556 vim inventory
  701. 557 ansible-playbook newdocker.yaml
  702. 558 vim newdocker.yaml
  703. 559 ansible-playbook newdocker.yaml
  704. 560 vim newdocker.yaml
  705. 561 ansible-playbook newdocker.yaml
  706. 562 cd ..
  707. 563 vim docker-ubuntu.yaml
  708. 564 cd docker/
  709. 565 ls
  710. 566 vim newdocker.yaml
  711. 567 ansible-playbook newdocker.yaml
  712. 568 vim ../docker-ubuntu.yaml
  713. 569 vim newdocker.yaml
  714. 570 ansible-playbook --tags rundocker newdocker.yaml
  715. 571 vim newdocker.yaml
  716. 572 ansible-playbook --tags rundocker newdocker.yaml
  717. 573 vim ../docker-ubuntu.yaml
  718. 574 ansible ubuntu -m package -a "name=pip3 state=latest"
  719. 575 ansible ubuntu -m package -a "name=pip state=latest"
  720. 576 vim newdocker.yaml
  721. 577 ansible-playbook newdocker.yaml
  722. 578 history
  723.  
  724. #####Last playbook troubleshooting failing docker stuff[ansible@controller docker]$ cat newdocker.yaml
  725. - name: developing docker o ubuntu setup
  726. hosts: ubuntu
  727. tasks:
  728. - name: run apt update
  729. command: apt-get update
  730. - name: install prereq packages
  731. package:
  732. name:
  733. - apt-transport-https
  734. - ca-certificates
  735. - curl
  736. - gnupg-agent
  737. - software-properties-common
  738. - pip
  739. state: latest
  740. - name: import repo gpg key
  741. shell: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
  742. - name: add repo
  743. shell: add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  744. - name: apt update
  745. command: apt-get update
  746. - name: install packages
  747. package:
  748. name:
  749. - docker-ce
  750. - docker-ce-cli
  751. - containerd.io
  752. state: latest
  753. - debug:
  754. msg: if you come this far, change all command and shell modules for something better
  755. tags: setupdocker
  756.  
  757. - name: running the docker container
  758. hosts: ubuntu
  759. tasks:
  760. - name: install docker pip module
  761. pip:
  762. name: docker
  763. - name: start and enable docker daemon
  764. service:
  765. name: docker
  766. enabled: yes
  767. state: started
  768. - name: create container
  769. docker_container:
  770. name: mynginx
  771. image: nginx
  772. state: started
  773. - name: generate a list of running containers
  774. command: docker ps
  775. register: dockerps
  776. - name: show list of running containers
  777. debug:
  778. var: dockerps.stdout
  779. tags: rundocker
  780.  
Advertisement
Add Comment
Please, Sign In to add comment