Advertisement
sandervanvugt

ansible3weeks day2 sept22

Sep 16th, 2022
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.98 KB | None | 0 0
  1. [ansible@control factcache]$ history
  2. 1 cd ansiblein3weeks/
  3. 2 ./countdown 12
  4. 3 cd ansiblein3weeks/
  5. 4 ./countdown 1
  6. 5 cd ansiblein3weeks/
  7. 6 ./countdown 12
  8. 7 ip a
  9. 8 sudo vim /etc/hosts
  10. 9 ssh root@ansible1
  11. 10 sudo dnf search ansible
  12. 11 sudo dnf install ansible-core
  13. 12 ansible --version
  14. 13 history
  15. 14 vim inventory
  16. 15 ansible -i inventory all -m command -a "useradd ansible"
  17. 16 ping ansible2
  18. 17 ping ansible1
  19. 18 ansible -i inventory all -m command -a "useradd ansible" -k
  20. 19 ssh ansible1
  21. 20 ssh root@ansible1
  22. 21 ssh root@ansible2
  23. 22 ansible -i inventory all -m command -a "useradd ansible" -k -u root
  24. 23 ansible -i inventory all -m command -a "useradd ansible" -k -u student -b -K
  25. 24 history
  26. 25 sudo echo password | passwd --stdin ansible
  27. 26 sudo sh -c 'echo password | passwd --stdin ansible'
  28. 27 ansible -i inventory -m command -a "rpm -qa | grep bash"
  29. 28 ansible -i inventory all -m command -a "rpm -qa | grep bash"
  30. 29 ansible -i inventory all -m command -a "rpm -qa | grep bash" -k
  31. 30 ansible -i inventory all -m command -a "rpm -qa | grep bash" -k -u root
  32. 31 ansible -i inventory all -m shell -a "rpm -qa | grep bash" -k -u root
  33. 32 ansible -i inventory all -m shell -a "echo password | passwd --stdin ansible" -k -u root
  34. 33 ansible -i inventory all -m command -a "whoami" -k
  35. 34 ansible -i inventory all -m command -a "ls -l /root" -k
  36. 35 ansible -i inventory all -m command -a "ls -l /root" -k -b
  37. 36 ansible -i inventory all -m command -a "ls -l /root" -k -b -K
  38. 37 sudo dnf install git
  39. 38 git clone https://github.com/sandervanvugt/ansiblein3weeks
  40. 39 cd ansiblein3weeks/
  41. 40 ls
  42. 41 history
  43. 42 ansible-doc copy
  44. 43 #ansible -i inventory all -m copy -a "content='ansible ALL=(ALL) NOPASSWD: ALL' dest=/etc/sudoers.d/ansible" -u root -k
  45. 44 sudo visudo
  46. 45 ansible -i inventory all -m copy -a "content='ansible ALL=(ALL) NOPASSWD: ALL' dest=/etc/sudoers.d/ansible" -u root -k
  47. 46 cat inventory
  48. 47 ansible -i inventory all -m copy -a "content='ansible ALL=(ALL) NOPASSWD: ALL' dest=/etc/sudoers.d/ansible" -u root -k
  49. 48 ansible -i inventory all -m command -a "ls -l /root" -k -b -K
  50. 49 history
  51. 50 ssh-keygen
  52. 51 ssh-copy-id ansible1.example.com
  53. 52 ssh-copy-id ansible2.example.com
  54. 53 ssh-copy-id control.example.com
  55. 54 ansible -i inventory all -m command -a "ls -l /root" -b
  56. 55 history
  57. 56 ansible -i inventory all -m command -a "useradd lisa" -b
  58. 57 ansible -i inventory all -m user -a "name=lisa" -b
  59. 58 history
  60. 59 ansible -i inventory all -m command -a "date"
  61. 60 vim ansible.cfg
  62. 61 ansible all -m command -a "date"
  63. 62 ansible all -m command -a "ls -l /root"
  64. 63 ansible all -m command -a "ls -l /root" -b
  65. 64 history
  66. 65 ansible --version
  67. 66 ansible-doc -l
  68. 67 ansible-doc -l | wc
  69. 68 ansible-galaxy collection install azure.azcollection
  70. 69 ansible-doc -l
  71. 70 cd basics/
  72. 71 ls
  73. 72 history | grep git
  74. 73 ls
  75. 74 vim run_and_test_httpd.yaml
  76. 75 ln ../inventory inventory
  77. 76 ln ../ansible.cfg ansible.cfg
  78. 77 vim inventory
  79. 78 vim ansible.cfg
  80. 79 ansible-playbook run_and_test_httpd.yaml
  81. 80 vim ansible.cfg
  82. 81 vim run_and_test_httpd.yaml
  83. 82 ansible-playbook run_and_test_httpd.yaml
  84. 83 vim run_and_test_httpd.yaml
  85. 84 ansible ansible2 -a "firewall-cmd --list-all" -b
  86. 85 ansible-doc firewalld
  87. 86 history | grep collection
  88. 87 ansible-galaxy collection install ansible.posix
  89. 88 ansible-doc -l | grep posix
  90. 89 ansible-doc firewalld
  91. 90 vim run_and_test_httpd.yaml
  92. 91 ansible-playbook run_and_test_httpd.yaml
  93. 92 vim run_and_test_httpd.yaml
  94. 93 curl ansible2
  95. 94 curl http://ansible2
  96. 95 ping ansible2
  97. 96 curl https://ansible2
  98. 97 history
  99. 98 ansible ansible2 -a "firewall-cmd --list-all" -b
  100. 99 vim run_and_test_httpd.yaml
  101. 100 ansible-playbook run_and_test_httpd.yaml
  102. 101 curl http://ansible2
  103. 102 vim run_and_test_httpd.yaml
  104. 103 ansible-doc uri
  105. 104 vim run_and_test_httpd.yaml
  106. 105 ansible-playbook run_and_test_httpd.yaml
  107. 106 vim run_and_test_httpd.yaml
  108. 107 ls
  109. 108 vim variables_example.yaml
  110. 109 ansible-playbook variables_example.yaml
  111. 110 ansible-playbook variables_example.yaml -e user=bob
  112. 111 vim variables_example.yaml
  113. 112 ansible-playbook variables_example.yaml -e user=bob
  114. 113 ../countdown 18
  115. 114 ls
  116. 115 vim gather_facts.yaml
  117. 116 ansible-playbook gather_facts.yaml | less
  118. 117 vim gather_facts.yaml
  119. 118 ansible-playbook gather_facts.yaml
  120. 119 ansible ansible1 -m setup | less
  121. 120 vim old_facts.yaml
  122. 121 ansible-playbook old_facts.yaml
  123. 122 vim new_facts.yaml
  124. 123 ansible-playbook new_facts.yaml
  125. 124 vim new_facts.yaml
  126. 125 ansible ansible1 -m setup | less
  127. 126 vim myvars.yaml
  128. 127 vim vars_file.yaml
  129. 128 ansible-playbook vars_file.yaml
  130. 129 ansible-playbook vars_file.yaml -b
  131. 130 ls
  132. 131 vim inventory
  133. 132 mkdir web
  134. 133 vim web/group_vars
  135. 134 vim vars_file.yaml
  136. 135 ansible-playbook vars_file.yaml
  137. 136 ls
  138. 137 vim inventory
  139. 138 vim web/group_vars
  140. 139 mkdir group_vars
  141. 140 mv web/group_vars group_vars/web
  142. 141 ansible-playbook vars_file.yaml
  143. 142 ansible-playbook vars_file.yaml -b
  144. 143 vim vars_file.yaml
  145. 144 ls\
  146. 145 ls
  147. 146 rm -rf web/
  148. 147 history
  149. 148 sudo poweroff
  150. 149 ssh-add ~/.ssh/id_rsa
  151. 150 ssh ansible1
  152. 151 ssh ansible2
  153. 152 vim securedo.yaml
  154. 153 ansible-playbook securedo.yaml
  155. 154 vim securedo.yaml
  156. 155 ansible-playbook securedo.yaml
  157. 156 ansible all -m copy -a "'content=ansible ALL=(ALL): ALL' dest=/etc/sudoers.d/ansible force=yes"
  158. 157 ansible all -m copy -a "content='ansible ALL=(ALL): ALL' dest=/etc/sudoers.d/ansible force=yes"
  159. 158 ansible all -m copy -a "content='ansible ALL=(ALL): ALL' dest=/etc/sudoers.d/ansible force=yes" -b
  160. 159 ansible all -a 'ls -l /root'
  161. 160 ansible all -a 'ls -l /root' -b
  162. 161 ansible all -a 'ls -l /root' -b -K
  163. 162 ssh ansible@ansible1
  164. 163 ssh ansible2
  165. 164 ansible all -a 'ls -l /root' -b -K
  166. 165 ansible all -a 'ls -l /root' -b
  167. 166 ../countdown 20
  168. 167 cd ../filters/
  169. 168 ls
  170. 169 vim int-filter.yaml
  171. 170 ansible-playbook int-filter.yaml
  172. 171 cp ../inventory .
  173. 172 cp ../ansible.cfg .
  174. 173 ansible-playbook int-filter.yaml
  175. 174 vim int-filter.yaml
  176. 175 ansible-playbook int-filter.yaml
  177. 176 vim int-filter.yaml
  178. 177 ansible-playbook int-filter.yaml
  179. 178 vim storage-filter.yaml
  180. 179 vim password_hash.yaml
  181. 180 ansible-playbook password_hash.yaml
  182. 181 ansible-playbook password_hash.yaml -b
  183. 182 vim assert_filter.yaml
  184. 183 ansible-playbook assert_filter.yaml
  185. 184 sudo dnf install -y python3-netaddr
  186. 185 ls
  187. 186 cd ..
  188. 187 ls
  189. 188 cd plugins/
  190. 189 ls
  191. 190 vim network.yaml
  192. 191 ansible-playbook network.yaml
  193. 192 cat ansible.cfg
  194. 193 cat inventory
  195. 194 cp ../inventory .
  196. 195 ansible-playbook network.yaml
  197. 196 ansible-galaxy collection install ansible.netcommon
  198. 197 ansible-playbook network.yaml
  199. 198 vim network.yaml
  200. 199 ansible-playbook network.yaml
  201. 200 #ansible-galaxy collection install ansible.netcommon
  202. 201 vim readkeys.yaml
  203. 202 ansible-playbook readkeys.yaml
  204. 203 vim readkeys.yaml
  205. 204 ls
  206. 205 ls ansible/id_rsa.pub
  207. 206 ansible-doc -t lookup -l
  208. 207 ansible-doc -t lookup file
  209. 208 ls
  210. 209 vim hello.yml
  211. 210 ansible-playbook hello.yml
  212. 211 find .. -name "mytemplate*"
  213. 212 cp ../templates/mytemplate.j2 .
  214. 213 ansible-playbook hello.yml
  215. 214 vim mytemplate.j2
  216. 215 ../countdown 9
  217. 216 vim nm-week3.yaml
  218. 217 vim ansible.cfg
  219. 218 ls
  220. 219 ansible-playbook hello.yml
  221. 220 ansible-inventory --yaml -i inventory --list --output inventory.yaml
  222. 221 vim ansible.cfg
  223. 222 ansible-inventory --yaml -i inventory --list --output inventory.yaml
  224. 223 vim inventory.yaml
  225. 224 cat ../windows/inventory
  226. 225 ansible-inventory --yaml -i ../windows/inventory --list --output winventory.yaml
  227. 226 vim winventory.yaml
  228. 227 ansible-doc -t inventory -l
  229. 228 sudo dnf install -y redis
  230. 229 sudo systemctl enable --now redis
  231. 230 sudo pip3 install redis
  232. 231 sudo dnf install python3-pip -y
  233. 232 sudo pip3 install redis
  234. 233 vim ansible.cfg
  235. 234 ansible all -m setup
  236. 235 ls
  237. 236 cd ..
  238. 237 ls
  239. 238 cd factcache/
  240. 239 ls
  241. 240 ./checkcache.py
  242. 241 vim ansible.cfg
  243. 242 ansible all -m setup | less
  244. 243 ansible-galaxy collection install community.general
  245. 244 ansible all -m setup | less
  246. 245 vim inventory
  247. 246 ansible all -m setup
  248. 247 ./checkcache.py
  249. 248 ansible all -m setup | less
  250. 249 vim checkfacts.yaml
  251. 250 ansible-playbook checkfacts.yaml
  252. 251 vim checkfacts.yaml
  253. 252 history
  254.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement