Advertisement
sandervanvugt

ans3weeks sept22 day1

Sep 9th, 2022
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.36 KB | None | 0 0
  1. [ansible@control basics]$ history
  2. 1 ip a
  3. 2 sudo vim /etc/hosts
  4. 3 ssh root@ansible1
  5. 4 sudo dnf search ansible
  6. 5 sudo dnf install ansible-core
  7. 6 ansible --version
  8. 7 history
  9. 8 vim inventory
  10. 9 ansible -i inventory all -m command -a "useradd ansible"
  11. 10 ping ansible2
  12. 11 ping ansible1
  13. 12 ansible -i inventory all -m command -a "useradd ansible" -k
  14. 13 ssh ansible1
  15. 14 ssh root@ansible1
  16. 15 ssh root@ansible2
  17. 16 ansible -i inventory all -m command -a "useradd ansible" -k -u root
  18. 17 ansible -i inventory all -m command -a "useradd ansible" -k -u student -b -K
  19. 18 history
  20. 19 sudo echo password | passwd --stdin ansible
  21. 20 sudo sh -c 'echo password | passwd --stdin ansible'
  22. 21 ansible -i inventory -m command -a "rpm -qa | grep bash"
  23. 22 ansible -i inventory all -m command -a "rpm -qa | grep bash"
  24. 23 ansible -i inventory all -m command -a "rpm -qa | grep bash" -k
  25. 24 ansible -i inventory all -m command -a "rpm -qa | grep bash" -k -u root
  26. 25 ansible -i inventory all -m shell -a "rpm -qa | grep bash" -k -u root
  27. 26 ansible -i inventory all -m shell -a "echo password | passwd --stdin ansible" -k -u root
  28. 27 ansible -i inventory all -m command -a "whoami" -k
  29. 28 ansible -i inventory all -m command -a "ls -l /root" -k
  30. 29 ansible -i inventory all -m command -a "ls -l /root" -k -b
  31. 30 ansible -i inventory all -m command -a "ls -l /root" -k -b -K
  32. 31 sudo dnf install git
  33. 32 git clone https://github.com/sandervanvugt/ansiblein3weeks
  34. 33 cd ansiblein3weeks/
  35. 34 ls
  36. 35 history
  37. 36 ansible-doc copy
  38. 37 #ansible -i inventory all -m copy -a "content='ansible ALL=(ALL) NOPASSWD: ALL' dest=/etc/sudoers.d/ansible" -u root -k
  39. 38 sudo visudo
  40. 39 ansible -i inventory all -m copy -a "content='ansible ALL=(ALL) NOPASSWD: ALL' dest=/etc/sudoers.d/ansible" -u root -k
  41. 40 cat inventory
  42. 41 ansible -i inventory all -m copy -a "content='ansible ALL=(ALL) NOPASSWD: ALL' dest=/etc/sudoers.d/ansible" -u root -k
  43. 42 ansible -i inventory all -m command -a "ls -l /root" -k -b -K
  44. 43 history
  45. 44 ssh-keygen
  46. 45 ssh-copy-id ansible1.example.com
  47. 46 ssh-copy-id ansible2.example.com
  48. 47 ssh-copy-id control.example.com
  49. 48 ansible -i inventory all -m command -a "ls -l /root" -b
  50. 49 history
  51. 50 ansible -i inventory all -m command -a "useradd lisa" -b
  52. 51 ansible -i inventory all -m user -a "name=lisa" -b
  53. 52 history
  54. 53 ansible -i inventory all -m command -a "date"
  55. 54 vim ansible.cfg
  56. 55 ansible all -m command -a "date"
  57. 56 ansible all -m command -a "ls -l /root"
  58. 57 ansible all -m command -a "ls -l /root" -b
  59. 58 history
  60. 59 ansible --version
  61. 60 ansible-doc -l
  62. 61 ansible-doc -l | wc
  63. 62 ansible-galaxy collection install azure.azcollection
  64. 63 ansible-doc -l
  65. 64 cd basics/
  66. 65 ls
  67. 66 history | grep git
  68. 67 ls
  69. 68 vim run_and_test_httpd.yaml
  70. 69 ln ../inventory inventory
  71. 70 ln ../ansible.cfg ansible.cfg
  72. 71 vim inventory
  73. 72 vim ansible.cfg
  74. 73 ansible-playbook run_and_test_httpd.yaml
  75. 74 vim ansible.cfg
  76. 75 vim run_and_test_httpd.yaml
  77. 76 ansible-playbook run_and_test_httpd.yaml
  78. 77 vim run_and_test_httpd.yaml
  79. 78 ansible ansible2 -a "firewall-cmd --list-all" -b
  80. 79 ansible-doc firewalld
  81. 80 history | grep collection
  82. 81 ansible-galaxy collection install ansible.posix
  83. 82 ansible-doc -l | grep posix
  84. 83 ansible-doc firewalld
  85. 84 vim run_and_test_httpd.yaml
  86. 85 ansible-playbook run_and_test_httpd.yaml
  87. 86 vim run_and_test_httpd.yaml
  88. 87 curl ansible2
  89. 88 curl http://ansible2
  90. 89 ping ansible2
  91. 90 curl https://ansible2
  92. 91 history
  93. 92 ansible ansible2 -a "firewall-cmd --list-all" -b
  94. 93 vim run_and_test_httpd.yaml
  95. 94 ansible-playbook run_and_test_httpd.yaml
  96. 95 curl http://ansible2
  97. 96 vim run_and_test_httpd.yaml
  98. 97 ansible-doc uri
  99. 98 vim run_and_test_httpd.yaml
  100. 99 ansible-playbook run_and_test_httpd.yaml
  101. 100 vim run_and_test_httpd.yaml
  102. 101 ls
  103. 102 vim variables_example.yaml
  104. 103 ansible-playbook variables_example.yaml
  105. 104 ansible-playbook variables_example.yaml -e user=bob
  106. 105 vim variables_example.yaml
  107. 106 ansible-playbook variables_example.yaml -e user=bob
  108. 107 ../countdown 18
  109. 108 ls
  110. 109 vim gather_facts.yaml
  111. 110 ansible-playbook gather_facts.yaml | less
  112. 111 vim gather_facts.yaml
  113. 112 ansible-playbook gather_facts.yaml
  114. 113 ansible ansible1 -m setup | less
  115. 114 vim old_facts.yaml
  116. 115 ansible-playbook old_facts.yaml
  117. 116 vim new_facts.yaml
  118. 117 ansible-playbook new_facts.yaml
  119. 118 vim new_facts.yaml
  120. 119 ansible ansible1 -m setup | less
  121. 120 vim myvars.yaml
  122. 121 vim vars_file.yaml
  123. 122 ansible-playbook vars_file.yaml
  124. 123 ansible-playbook vars_file.yaml -b
  125. 124 ls
  126. 125 vim inventory
  127. 126 mkdir web
  128. 127 vim web/group_vars
  129. 128 vim vars_file.yaml
  130. 129 ansible-playbook vars_file.yaml
  131. 130 ls
  132. 131 vim inventory
  133. 132 vim web/group_vars
  134. 133 mkdir group_vars
  135. 134 mv web/group_vars group_vars/web
  136. 135 ansible-playbook vars_file.yaml
  137. 136 ansible-playbook vars_file.yaml -b
  138. 137 vim vars_file.yaml
  139. 138 ls\
  140. 139 ls
  141. 140 rm -rf web/
  142. 141 history
  143.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement