Advertisement
sandervanvugt

ansible4H june22

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