Advertisement
sandervanvugt

ansible3W day2 june22

Jun 16th, 2022
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.52 KB | None | 0 0
  1. [ansible@control factcache]$ history
  2. 1 sudo ls /root
  3. 2 ssh-keygen
  4. 3 ssh-copy-id ansible1
  5. 4 ssh-copy-id ansible2
  6. 5 ssh ansible1
  7. 6 ssh ansible2
  8. 7 sudo hostnamectl set-hostname control.example.com
  9. 8 exit
  10. 9 vim inventory
  11. 10 ansible all -i inventory -u root -k -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  12. 11 ansible all -i inventory -u ansible -m command -a "whoami"
  13. 12 ansible all -i inventory -u ansible -m command -a "ls -l /root"
  14. 13 ansible all -i inventory -u ansible -b -m command -a "ls -l /root"
  15. 14 ansible all -i inventory -u ansible -b -m command -a "whoami"
  16. 15 sudo dnf install git
  17. 16 git clone https://github.com/sandervanvugt/ansiblein3weeks
  18. 17 cd ansiblein3weeks/
  19. 18 ./countdown 12
  20. 19 ls
  21. 20 vim inventory
  22. 21 vim ansible.cfg
  23. 22 vim /etc/ansible/ansible.cfg
  24. 23 ansible --version
  25. 24 ansible-inventory --graph
  26. 25 ansible ansible1 -m command -a "useradd lisa"
  27. 26 ansible ansible1 -m user -a "name=lisa"
  28. 27 ansible-galaxy collection install ansible.posix
  29. 28 ansible-doc -l | wc
  30. 29 ansible-doc -l
  31. 30 ansible-doc user
  32. 31 ansible-galaxy collection install amazon.aws
  33. 32 ansible-doc -l | wc
  34. 33 vim ansible.cfg
  35. 34 ansible all -m command -a "rpm -qa | grep bash"
  36. 35 ansible all -m shell -a "rpm -qa | grep bash"
  37. 36 ssh-copy-id control
  38. 37 ansible all -m shell -a "rpm -qa | grep bash"
  39. 38 ls
  40. 39 vim create-user.yml
  41. 40 cd basics/
  42. 41 ls
  43. 42 vim install_and_start_httpt.yaml
  44. 43 ansible-playbook install_and_start_httpt.yaml
  45. 44 cat inventory
  46. 45 ansible-playbook install_and_start_httpt.yaml
  47. 46 ls
  48. 47 ln ../ansible.cfg ansible.cfg
  49. 48 ansible-playbook install_and_start_httpt.yaml
  50. 49 vim inventory
  51. 50 ansible nodes -m copy -a "src=/etc/hosts dest=/etc/hosts"
  52. 51 ansible-playbook install_and_start_httpt.yaml
  53. 52 vim ansible.cfg
  54. 53 ansible --help | less
  55. 54 ../countdown 12
  56. 55 vim variables_example.yaml
  57. 56 ansible-playbook variables_example.yaml
  58. 57 vim variables_example.yaml
  59. 58 ansible-playbook variables_example.yaml -e user=bob
  60. 59 vim gather_facts.yaml
  61. 60 ansible-playbook gather_facts.yaml
  62. 61 vim gather_facts.yaml
  63. 62 ansible-playbook gather_facts.yaml
  64. 63 ansible ansible2 -m setup | less
  65. 64 vim gather_facts.yaml
  66. 65 ansible ansible2 -m setup | less
  67. 66 ansible-playbook gather_facts.yaml
  68. 67 vim gather_facts.yaml
  69. 68 ansible-playbook gather_facts.yaml
  70. 69 vim old_facts.yaml
  71. 70 vim new_facts.yaml
  72. 71 ansible-playbook new_facts.yaml
  73. 72 ../countdown 1
  74. 73 vim myvars.yaml
  75. 74 vim vars_file.yaml
  76. 75 ansible-playbook vars_file.yaml
  77. 76 ansible localhost -m debug -a 'var=hostvars'
  78. 77 ls
  79. 78 cd ..
  80. 79 ls
  81. 80 cd basics/
  82. 81 vim vars_file.yaml
  83. 82 mkdir host_vars
  84. 83 vim host_vars/ansible1
  85. 84 ansible-playbook vars_file.yaml
  86. 85 vim vars_file.yaml
  87. 86 ansible-playbook vars_file.yaml
  88. 87 vim host_vars/ansible1
  89. 88 ansible-playbook vars_file.yaml
  90. 89 mkdir group_vars
  91. 90 vim group_vars/all
  92. 91 vim vars_file.yaml
  93. 92 ansible-playbook vars_file.yaml
  94. 93 ls
  95. 94 cd ..
  96. 95 find . -name register*
  97. 96 vim register.yaml
  98. 97 ansible-playbook register.yaml
  99. 98 cd basics/
  100. 99 ansible-inventory --graph --vars
  101. 100 ../countdown 18
  102. 101 ls
  103. 102 cd ..
  104. 103 ls
  105. 104 vim secret.yml
  106. 105 rm secret.yml
  107. 106 ansible-vault --help
  108. 107 ansible-vault create secret.yml
  109. 108 cat secret.yml
  110. 109 ls
  111. 110 vim create-user.yml
  112. 111 ansible-playbook create-user.yml
  113. 112 ansible-playbook --ask-vault-pass create-user.yml
  114. 113 ansible all -a "tail -1 /etc/shadow"
  115. 114 echo password > vault-pass
  116. 115 ansible-playbook --vault-password-file=vault-pass create-user.yml
  117. 116 ls
  118. 117 cd templates/
  119. 118 ls
  120. 119 vim vsftpd.j2
  121. 120 vim vsftpd-template.yml
  122. 121 ansible-doc -l | grep template
  123. 122 vim vsftpd-template.yml
  124. 123 ansible-playbook vsftpd-template.yml
  125. 124 pwd
  126. 125 ln ../inventory inventory
  127. 126 ln ../ansible ansible
  128. 127 ln ../ansible.cfg ansible.cfg
  129. 128 ansible-playbook vsftpd-template.yml
  130. 129 ansible ansible1 -a "cat /etc/vsftpd/vsftpd.conf"
  131. 130 cd ..
  132. 131 ls
  133. 132 cd task_control/
  134. 133 ls
  135. 134 ln ../ansible.cfg ansible.cfg
  136. 135 ln ../inventory inventory
  137. 136 vim handlers.yml
  138. 137 touch /tmp/index.html
  139. 138 ansible-playbook handlers.yml
  140. 139 vim handlers.yml
  141. 140 ansible-playbook handlers.yml
  142. 141 ansible ansible1 -m file -a "name=/var/www/html/index.html state=absent"
  143. 142 ansible-playbook handlers.yml
  144. 143 ls
  145. 144 vim loopservices.yml
  146. 145 ansible-playbook loopservices.yml
  147. 146 ls
  148. 147 vim ifsize.yml
  149. 148 ansible-playbook ifsize.yml
  150. 149 vim ifsize.yml
  151. 150 ansible-playbook ifsize.yml
  152. 151 ls
  153. 152 vim when_multiple.yml
  154. 153 ansible-playbook when_multiple.yml
  155. 154 vim when_multiple.yml
  156. 155 ansible-playbook when_multiple.yml
  157. 156 ../countdown 12
  158. 157 cat /etc/hosts
  159. 158 sudo -i
  160. 159 exit
  161. 160 history
  162. 161 sudo poweroff
  163. 162 ssh-add ~/.ssh/id_rsa
  164. 163 ssh-copy-id ansible1
  165. 164 ssh-copy-id ansible2
  166. 165 ansible all -a "whoami"
  167. 166 ssh-copy-id control
  168. 167 ls
  169. 168 grep -R lineinfile *
  170. 169 vim setup.yaml
  171. 170 vim setup_security.yaml
  172. 171 cat ansible.cfg
  173. 172 ansible-playbook --help | grep -k
  174. 173 ansible-playbook --help
  175. 174 ansible-playbook -K setup_security.yaml
  176. 175 vim setup_security.yaml
  177. 176 ansible-playbook -K setup_security.yaml
  178. 177 ansible all -a 'ls /root'
  179. 178 ./countdown 13
  180. 179 ls
  181. 180 cd filters/
  182. 181 ls
  183. 182 ln ../inventory inventory
  184. 183 ln ../ansible.cfg ansible.cfg
  185. 184 vim int-filter.yaml
  186. 185 ansible-playbook int-filter.yaml
  187. 186 vim int-filter.yaml
  188. 187 ansible-playbook int-filter.yaml
  189. 188 vim int-filter.yaml
  190. 189 ansible-playbook int-filter.yaml
  191. 190 vim int-filter.yaml
  192. 191 vim storage-filter.yaml
  193. 192 vim assert_filter.yaml
  194. 193 ansible-playbook assert_filter.yaml
  195. 194 vim password_hash.yaml
  196. 195 ansible-playbook password_hash.yaml
  197. 196 ssh sharon@ansible2
  198. 197 ansible ansible2 -a "tail /etc/shadow"
  199. 198 ssh ansible2
  200. 199 ls
  201. 200 cd ..
  202. 201 cd plugins/
  203. 202 ls
  204. 203 vim network.yaml
  205. 204 ansible-playbook network.yaml
  206. 205 ansible-galaxy collection install ansible.netcommon
  207. 206 vim network.yaml
  208. 207 ansible-playbook network.yaml
  209. 208 dnf install -y python3-netaddr
  210. 209 sudo dnf install -y python3-netaddr
  211. 210 ansible-playbook network.yaml
  212. 211 vim network.yaml
  213. 212 ansible-playbook network.yaml
  214. 213 vim readkeys.yaml
  215. 214 ls
  216. 215 ls student/
  217. 216 ls ansible/id_rsa.pub
  218. 217 vim readkeys.yaml
  219. 218 ansible-playbook readkeys.yaml
  220. 219 vim ansible.cfg
  221. 220 ln ../inventory inventory
  222. 221 vim inventory
  223. 222 ansible-playbook readkeys.yaml
  224. 223 ansible all -a "ls -l /home/student/.ssh/"
  225. 224 ansible-doc -t lookup -l
  226. 225 ls
  227. 226 vim hello.yml
  228. 227 vim mytemplate.j2
  229. 228 ansible-playbook hello.yml
  230. 229 vim mytemplate.j2
  231. 230 vim hello.yml
  232. 231 ansible-doc -t callback -l
  233. 232 vim ansible.cfg
  234. 233 sudo dnf provides */cgcreate
  235. 234 sudo dnf repolist
  236. 235 sudo dnf install epel-release
  237. 236 sudo dnf provides */cgcreate
  238. 237 vim ansible.cfg
  239. 238 ../countdown 18
  240. 239 vim ansible.cfg
  241. 240 ls
  242. 241 ansible-playbook network.yaml
  243. 242 cd ../windows/
  244. 243 ls
  245. 244 vim inventory
  246. 245 ansible-inventory --yaml -i inventory --list --output winventory.yaml
  247. 246 vim winventory.yaml
  248. 247 ansible-doc -t inventory -l
  249. 248 less /etc/ansible/ansible.cfg
  250. 249 sudo -i
  251. 250 sudo dnf install -y redis
  252. 251 sudo systemctl enable --now redis
  253. 252 sudo dnf search redis
  254. 253 sudo pip3 install redis
  255. 254 sudo dnf provides */pip3
  256. 255 sudo dnf install python3-pip
  257. 256 sudo pip3 install redis
  258. 257 cd ../plugins/
  259. 258 vim ansible.cfg
  260. 259 ansible all -m setup
  261. 260 ls
  262. 261 cd ..
  263. 262 ls
  264. 263 cd factcache/
  265. 264 ls
  266. 265 vim ansible.cfg
  267. 266 vim checkcache.py
  268. 267 vim inventory
  269. 268 ansible all -m setup
  270. 269 ./checkcache.py
  271. 270 vim inventory
  272. 271 vim checkcache.py
  273. 272 ./checkcache.py
  274. 273 vim checkfacts.yaml
  275. 274 ansible-playbook checkfacts.yaml
  276. 275 history
  277.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement