Advertisement
sandervanvugt

ansible4H may23

May 8th, 2023
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.19 KB | None | 0 0
  1. [student@localhost ~]$ history
  2. 1 free -m
  3. 2 lscpu
  4. 3 ping 192.168.29.167
  5. 4 ping 192.168.29.168
  6. 5 ip
  7. 6 ip a
  8. 7 sudo vim /etc/hosts
  9. 8 ping control
  10. 9 ping ansible1
  11. 10 ping ansible2
  12. 11 ansible-galaxy collection install ansible.windows
  13. 12 sudo dnf install ansible-core
  14. 13 ansible --version
  15. 14 history
  16. 15 vim inventory
  17. 16 vim inventory
  18. 17 ansible -i inventory all -m command "useradd ansible"
  19. 18 ansible -i inventory all -m command -a "useradd ansible"
  20. 19 ssh student@control
  21. 20 ssh student@ansible1
  22. 21 ssh student@ansible2
  23. 22 ansible -i inventory all -m command -a "useradd ansible" -u student -k -b -K
  24. 23 ansible -i inventory all -m command -a "id ansible" -u student -k -b -K
  25. 24 ansible -i inventory all -m command -a "useradd ansible" -u student -k -b -K
  26. 25 ansible -i inventory all -m user -a "name=ansible" -u student -k -b -K
  27. 26 history
  28. 27 sudo dnf install git
  29. 28 git clone https://github.com/sandervanvugt/ansiblefundamentals
  30. 29 cd ansiblefundamentals/
  31. 30 ls
  32. 31 history
  33. 32 sudo -i
  34. 33 ansible -i inventory all -u student -b -k -K -m shell -a "echo password | passwd --stdin ansible"
  35. 34 cd ..
  36. 35 ansible -i inventory all -u student -b -k -K -m shell -a "echo password | passwd --stdin ansible"
  37. 36 history
  38. 37 ansible -i inventory all -u student -b -k -K -m command -a "rpm -qa | grep bash"
  39. 38 ansible -i inventory all -u student -b -k -K -m shell -a "rpm -qa | grep bash"
  40. 39 ansible -i inventory all -u student -b -k -K -m shell -a "echo password | passwd --stdin ansible"
  41. 40 history
  42. 41 ansible -i inventory all -u ansible -k -m command -a "whoami"
  43. 42 ansible -i inventory all -u ansible -k -m command -a "ls -l /root"
  44. 43 ansible -i inventory all -u ansible -k -m command -a "ls -l /root" -b -K
  45. 44 ansible -i inventory all -m copy -a 'content="ansible ALL=(ALL) NOPASSWD: ALL" dest=/etc/sudoers.d/ansible' -b -k -K -u student
  46. 45 ansible -i inventory all -u ansible -k -m command -a "ls -l /root" -b
  47. 46 su - ansible
  48. 47 history
  49. 48 su - ansible
  50. 49 history
  51.  
  52. [ansible@localhost ansiblefundamentals]$ history
  53. 1 vim inventory
  54. 2 ssh-keygen
  55. 3 ssh-copy-id ansible1
  56. 4 ssh-copy-id ansible2
  57. 5 ssh ansible1
  58. 6 ansible -i inventory all -m command -a "ls -l /root" -b
  59. 7 exit
  60. 8 history
  61. 9 git clone https://github.com/sandervanvugt/ansiblefundamentals
  62. 10 cd ansiblefundamentals/
  63. 11 ls
  64. 12 vim ansible.cfg
  65. 13 cp ../inventory .
  66. 14 ansible all -a "ls -l /root"
  67. 15 ansible-doc -l | less
  68. 16 ansible-doc copy
  69. 17 ansible ansible1 -m command -a "rpm -qa | grep python"
  70. 18 ansible ansible1 -m shell -a "rpm -qa | grep python"
  71. 19 ansible all -m copy -a 'content="hello world" dest=/etc/motd'
  72. 20 ansible all -m package -a "name=nmap state=latest"
  73. 21 ansible all -m service -a "name=httpd state=started enabled=yes"
  74. 22 ./countdown 12
  75. 23 vim install_and_start_httpt.yaml
  76. 24 ansible-playbook install_and_start_httpt.yaml
  77. 25 ansible-playbook install_and_start_httpt.yaml -v
  78. 26 ansible-playbook install_and_start_httpt.yaml -vvvvv
  79. 27 vim install_and_start_httpt.yaml
  80. 28 ansible-playbook install_and_start_httpt.yaml
  81. 29 ansible-playbook install_and_start_httpt.yaml --syntax-check
  82. 30 vim install_and_start_httpt.yaml
  83. 31 vim enforce-selinux
  84. 32 vim enforce-selinux.yml
  85. 33 ansible-playbook enforce-selinux.yml
  86. 34 ansible-galaxy collection install ansible.posix
  87. 35 ansible-doc -l | less
  88. 36 ansible-playbook enforce-selinux.yml
  89. 37 ansible-doc -l | less
  90. 38 vim enforce-selinux.yml
  91. 39 vim enforce-selinux-.yml
  92. 40 vim enforce-selinux-simplified.yml
  93. 41 vim run_and_test_httpd.yaml
  94. 42 ansible-playbook run_and_test_httpd.yaml
  95. 43 vim run_and_test_httpd.yaml
  96. 44 ansible-doc firewalld
  97. 45 vim run_and_test_httpd.yaml
  98. 46 ansible-playbook run_and_test_httpd.yaml
  99. 47 vim run_and_test_httpd.yaml
  100. 48 ansible-playbook run_and_test_httpd.yaml
  101. 49 vim run_and_test_httpd.yaml
  102. 50 vim multi_play.yaml
  103. 51 ansible-playbook multi_play.yaml
  104. 52 vim multi_play.yaml
  105. 53 ansible-doc yum
  106. 54 vim multi_play.yaml
  107. 55 ansible-doc service
  108. 56 vim multi_play.yaml
  109. 57 ansible-playbook multi_play.yaml
  110. 58 vim multi_play.yaml
  111. 59 vim variables_example.yaml
  112. 60 ansible-playbook variables_example.yaml
  113. 61 ansible-playbook variables_example.yaml -e user=bob
  114. 62 vim gather_facts.yaml
  115. 63 ansible-playbook gather_facts.yaml
  116. 64 ansible-playbook gather_facts.yaml | less
  117. 65 vim old_facts.yaml
  118. 66 vim new_facts.yaml
  119. 67 ansible-playbook new_facts.yaml
  120. 68 ansible all -m setup | less
  121. 69 vim old_facts.yaml
  122. 70 ansible-playbook old_facts.yaml
  123. 71 ansible-playbook new_facts.yaml
  124. 72 vim new_facts.yaml
  125. 73 ansible-playbook new_facts.yaml
  126. 74 vim new_facts.yaml
  127. 75 vim myvars.yaml
  128. 76 vim vars_file.yaml
  129. 77 ansible-playbook vars_file.yaml
  130. 78 ls
  131. 79 cd vars
  132. 80 ls
  133. 81 cd ..
  134. 82 mkdir host_vars
  135. 83 vim host_vars/ansible1
  136. 84 vim vars_file.yaml
  137. 85 ansible-playbook vars_file.yaml
  138. 86 vim vars_file.yaml
  139. 87 history
  140. 88 vim register.yaml
  141. 89 ansible-playbook register.yaml
  142. 90 vim register.yaml
  143. 91 ansible-playbook register.yaml
  144. 92 vim loop_packages.yaml
  145. 93 ansible-playbook loop_packages.yaml
  146. 94 vim loop_on_vars.yaml
  147. 95 cat vars/users-list
  148. 96 vim loop_on_vars.yaml
  149. 97 ansible-playbook loop_on_vars.yaml
  150. 98 vim loop_on_vars.yaml
  151. 99 vim when_test.yaml
  152. 100 ansible-playbook when_test.yaml
  153. 101 vim when_complex.yaml
  154. 102 ansible-playbook when_complex.yaml
  155. 103 vim when_register.yaml
  156. 104 ansible-playbook when_register.yaml
  157. 105 vim using_handlers.yaml
  158. 106 ansible-playbook using_handlers.yaml
  159. 107 vim using_handlers.yaml
  160. 108 ansible-playbook using_handlers.yaml
  161. 109 ansible all -m file -a "name=/var/www/html/index.html state=absent"
  162. 110 ansible-playbook using_handlers.yaml
  163. 111 history
  164.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement