Advertisement
sandervanvugt

ansible3weeks last day Oct21

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