Advertisement
sandervanvugt

ansible 3weeks day1 oct 2021

Oct 11th, 2021
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.28 KB | None | 0 0
  1. [ansible@controller ~]$ history
  2. 1 ssh-keygen
  3. 2 ssh-copy-id ubuntu
  4. 3 ssh-copy-id centos7
  5. 4 ssh-copy-id rhel84
  6. 5 ansible all -i inventory -u root -k -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  7. 6 ls
  8. 7 cd projectone/
  9. 8 ansible all -i inventory -u root -k -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  10. 9 ansible all -i inventory -u ansible -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  11. 10 cd ..
  12. 11 sudo dnf install git -y
  13. 12 git clone https://github.com/sandervanvugt/ansiblein3weeks
  14. 13 git clone https://github.com/sandervanvugt/ansible3weeks
  15. 14 git clone https://github.com/sandervanvugt/ansibleinthreeweeks
  16. 15 cd ansibleinthreeweeks/
  17. 16 ls
  18. 17 cd ..
  19. 18 git clone https://github.com/sandervanvugt/luth
  20. 19 luth/countdown 15
  21. 20 ansible ubuntu -i inventory -u ansible -k -K -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  22. 21 cd projectone/
  23. 22 ansible ubuntu -i inventory -u ansible -k -K -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  24. 23 ansible ubuntu -i inventory -u ansible -k -K -m command -a "ls -ld /etc/sudoers.d"
  25. 24 ansible ubuntu -i inventory -u ansible -k -K -m command -a "ls -la /root"
  26. 25 vim inventory
  27. 26 cat /etc/ansible/hosts
  28. 27 less /etc/ansible/ansible.cfg
  29. 28 cd ../ansibleinthreeweeks/
  30. 29 ls
  31. 30 cd basics/
  32. 31 ls
  33. 32 cd ..
  34. 33 find . -name "ansible.cfg"
  35. 34 vim ansible.cfg
  36. 35 cp ansible.cfg ../projectone/
  37. 36 cd ../projectone/
  38. 37 ls
  39. 38 vim inventory
  40. 39 cd -
  41. 40 cd collections/
  42. 41 ls
  43. 42 vim ansible.cfg
  44. 43 ansible-doc -l
  45. 44 ansible-doc -l | wc
  46. 45 cd ../../projectone/
  47. 46 history
  48. 47 ansible ubuntu -i inventory -u ansible -b -k -K -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  49. 48 cat ansible.cfg
  50. 49 ansible -m package -a "name=nmap"
  51. 50 ansible ubuntu -m package -a "name=nmap"
  52. 51 ansible-doc package
  53. 52 ansible all -m command -a "useradd -m -s /bin/bash linda"
  54. 53 vim inventory
  55. 54 ansible all -m command -a "id linda"
  56. 55 ansible all -m command -a "useradd -m -s /bin/bash linda"
  57. 56 ansible all -m user -a "name=linda"
  58. 57 ../luth/countdown 12
  59. 58 sudo vim /etc/hosts
  60. 59 cd ../ansibleinthreeweeks/
  61. 60 ls
  62. 61 cd collections/
  63. 62 ls
  64. 63 vim enforce-selinux.yml
  65. 64 cd ../../projectone/
  66. 65 ansible all -m ping
  67. 66 ansible all -m user -a "name=lisa"
  68. 67 ansible all -m command -a "id lisa"
  69. 68 ansible all -m user -a "name=lisa state=absent"
  70. 69 ansible all -m command -a "id lisa"
  71. 70 ansible centos7 -m command -a "rpm -qa | grep python"
  72. 71 ansible centos7 -m shell -a "rpm -qa | grep python"
  73. 72 ansible all -m copy -a 'content="hello world" dest=/etc/motd'
  74. 73 ansible all -m command -a "cat /etc/motd"
  75. 74 ansible all -m package -a "name=nmap state=latest"
  76. 75 ansible all -m service -a "name=httpd state=started"
  77. 76 cd ../ansibleinthreeweeks/
  78. 77 ls
  79. 78 cd basics/
  80. 79 ls
  81. 80 cp ../../projectone/* .
  82. 81 ls
  83. 82 vim install_and_start_httpt.yaml
  84. 83 ansible-doc service
  85. 84 ls
  86. 85 ansible-playbook install_and_start_httpt.yaml
  87. 86 cd ..
  88. 87 ../luth/countdown 25
  89. 88 vim kp.yaml
  90. 89 ansible-doc service
  91. 90 vim kp.yaml
  92. 91 ansible-doc firewalld
  93. 92 vim kp.yaml
  94. 93 ansible-playbook kp.yaml
  95. 94 cd ../projectone/
  96. 95 ansible-playbook ../ansibleinthreeweeks/kp.yaml
  97. 96 cd ../ansibleinthreeweeks/basics/
  98. 97 ls
  99. 98 vim multi_play.yaml
  100. 99 cp ../../projectone/inventory .
  101. 100 ansible-playbook multi_play.yaml
  102. 101 vim multi_play.yaml
  103. 102 ansible-doc yum
  104. 103 vim multi_play.yaml
  105. 104 ansible-doc yum
  106. 105 ansible-playbook multi_play.yaml
  107. 106 cd ../..
  108. 107 git clone https://github.com/sandervanvugt/rhce8-live
  109. 108 cd rhce8-live/
  110. 109 ls
  111. 110 cd lesson16/
  112. 111 ls
  113. 112 vim software-advanced.yml
  114. 113 vim setup-rhel.yml
  115. 114 grep prompt *
  116. 115 cd ..
  117. 116 grep -r prompt *
  118. 117 cat lesson15/assertsize.yml
  119. 118 cd lesson16/
  120. 119 ls
  121. 120 vim setup-rhel.yml
  122. 121 ansible-playbook setup-rhel.yml
  123. 122 vim inventory
  124. 123 ansible-playbook setup-rhel.yml
  125. 124 vim setup-rhel.yml
  126. 125 cp setup-rhel.yml ~/ansibleinthreeweeks/
  127. 126 cd ~/ansibleinthreeweeks/
  128. 127 ls
  129. 128 cd basics/
  130. 129 ls
  131. 130 ansible-playbook playbook_with_errors.yaml
  132. 131 vim playbook_with_errors.yaml
  133. 132 ansible-playbook playbook_with_errors.yaml
  134. 133 vim playbook_with_errors.yaml
  135. 134 ansible-playbook playbook_with_errors.yaml
  136. 135 vim playbook_with_errors.yaml
  137. 136 ansible-playbook playbook_with_errors.yaml
  138. 137 vim playbook_with_errors.yaml
  139. 138 pwd
  140. 139 ../../luth/countdown 12
  141. 140 cd ..
  142. 141 cd basics/
  143. 142 vim inventory
  144. 143 ansible rhel84 -a "yum repolist"
  145. 144 ls
  146. 145 vim variables_example.yaml
  147. 146 ansible-playbook variables_example.yaml
  148. 147 ansible-playbook variables_example.yaml -e user=bob
  149. 148 vim variables_example.yaml
  150. 149 ansible rhel84 -m setup > rhelfacts.txt
  151. 150 less rhelfacts.txt
  152. 151 ansible-doc -l | grep fact
  153. 152 ansible-doc -l | grep _fact
  154. 153 vim gather_facts.yaml
  155. 154 less rhelfacts.txt
  156. 155 ansible-playbook gather_facts.yaml
  157. 156 ls
  158. 157 vim old_facts.yaml
  159. 158 ansible-playbook old_facts.yaml
  160. 159 vim new_facts.yaml
  161. 160 ansible-playbook new_facts.yaml
  162. 161 vim new_facts.yaml
  163. 162 vim myvars.yaml
  164. 163 vim vars_file.yaml
  165. 164 ansible-playbook vars_file.yaml
  166. 165 ls
  167. 166 cp vars_file.yaml vars_host.yaml
  168. 167 mkdir host_vars
  169. 168 vim vars_host.yaml
  170. 169 vim host_vars/centos7
  171. 170 ansible-playbook vars_host.yaml
  172. 171 vim host_vars/centos7
  173. 172 ansible-playbook vars_host.yaml
  174. 173 cd ../
  175. 174 cd ../rhce8-live/lesson5/
  176. 175 ls
  177. 176 cd webservers/
  178. 177 ls
  179. 178 cat group_vars/lamp
  180. 179 vim site.yml
  181. 180 cd ../..
  182. 181 pwd
  183. 182 cd ../ansibleinthreeweeks/
  184. 183 cd basics/
  185. 184 ls
  186. 185 vim host_vars/centos7
  187. 186 ansible-playbook vars_host.yaml
  188. 187 cd ../..
  189. 188 cd rhce8-live/lesson16/
  190. 189 ls
  191. 190 vim software-advanced.yml
  192. 191 cd
  193. 192 history
  194.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement