sandervanvugt

ansible4H jan22

Jan 21st, 2022
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.90 KB | None | 0 0
  1. [ansible@control ansiblefundamentals]$ history
  2. 1 history
  3. 2 su -
  4. 3 sudo ls /root
  5. 4 sudo dnf install epel-release
  6. 5 history
  7. 6 sudo dnf install -y ansible
  8. 7 ansible --version
  9. 8 ip a
  10. 9 sudo vim /etc/hosts
  11. 10 ip a
  12. 11 sudo vim /etc/hosts
  13. 12 ping ansible1
  14. 13 ping ansible2
  15. 14 mkdir setup
  16. 15 cd setup/
  17. 16 ssh root@ansible1
  18. 17 ssh root@ansible2
  19. 18 vim inventory
  20. 19 ansible -i inventory all -m user -a "name=ansible"
  21. 20 ansible -i inventory all -m user -a "name=ansible" -u root -k
  22. 21 ansible -i inventory all -m shell -a "echo password | passwd --stdin ansible" -u root -k
  23. 22 ssh ansible@ansible1
  24. 23 history
  25. 24 ansible-doc user
  26. 25 ansible -i inventory all -m user -a "name=ansible groups=wheel" -u root -k
  27. 26 cd ..
  28. 27 sudo dnf install git
  29. 28 git clone https://github.com/sandervanvugt/ansiblefundamentals
  30. 29 cd ansiblefundamentals/
  31. 30 ls
  32. 31 git pull
  33. 32 history
  34. 33 cd ../setup/
  35. 34 ansible -i inventory all -m command -a "ls /root" -u ansible -k
  36. 35 ls /root
  37. 36 sudo ls /root
  38. 37 ansible -i inventory all -m command -a "ls /root" -u ansible -k -b
  39. 38 ansible -i inventory all -m command -a "ls /root" -u ansible -k -b -K
  40. 39 ansible -i inventory all -m copy -a "content='ansible ALL=(ALL) NOPASSWD: ALL' dest=/etc/sudoers.d/ansible"
  41. 40 ansible -i inventory all -m copy -a "content='ansible ALL=(ALL) NOPASSWD: ALL' dest=/etc/sudoers.d/ansible" -u ansible -k -K -b
  42. 41 ansible -i inventory all -m command -a "ls /root" -u ansible -k -b
  43. 42 vim ansible.cfg
  44. 43 history
  45. 44 cat ansible.cfg
  46. 45 ansible all -m command -a "ls /root" -k
  47. 46 cd
  48. 47 ssh-keygen
  49. 48 ssh-copy-id ansible1
  50. 49 ssh-copy-id ansible2
  51. 50 ansible all -m command -a "ls /root"
  52. 51 cd setup/
  53. 52 ls
  54. 53 ansible all -m command -a "ls /root"
  55. 54 history
  56. 55 sudo vim /etc/ansible/ansible.cfg
  57. 56 history
  58. 57 cat inventory
  59. 58 history | grep ansible
  60. 59 ansible-doc -l
  61. 60 ansible-doc -l | wc
  62. 61 ansible --version
  63. 62 ### ansible all -m raw -a "yum install python"
  64. 63 cat ansible.cfg
  65. 64 cat /etc/ansible/ansible.cfg
  66. 65 ansible ansible1 -m command -a "rpm -qa | grep python"
  67. 66 ansible ansible1 -m shell -a "rpm -qa | grep python"
  68. 67 ansible all -m copy -a 'content="hello world" dest=/etc/hello"
  69. 68 ansible all -m copy -a 'content="hello world" dest=/etc/hello'
  70. 69 ansible all -a "cat /etc/hello"
  71. 70 ansibe all -m package -a "name=nmap state=latest"
  72. 71 ansible all -m package -a "name=nmap state=latest"
  73. 72 ansible all -m service -a "name=httpd state=started"
  74. 73 ansible all -vvv -m service -a "name=httpd state=started"
  75. 74 ansible all -m copy -a "src=/etc/hosts dest=/etc/hosts"
  76. 75 ansible all -m service -a "name=httpd state=started"
  77. 76 history
  78. 77 ansible ansible1 -m user -a "name=lisa"
  79. 78 ansible ansible1 -m command -a "useradd linda"
  80. 79 ansible ansible1 -m user -a "name=linda"
  81. 80 vim ~/.vimrc
  82. 81 cp * ../ansiblefundamentals/
  83. 82 cd ../ansiblefundamentals/
  84. 83 ls
  85. 84 history
  86. 85 cat ~/.vimrc
  87. 86 vim install_and_start_httpt.yaml
  88. 87 ansible-playbook install_and_start_httpt.yaml
  89. 88 vim install_and_start_httpt.yaml
  90. 89 ansible-playbook install_and_start_httpt.yaml
  91. 90 vim install_and_start_httpt.yaml
  92. 91 rpm -qa | grep systemd | less
  93. 92 vim install_and_start_httpt.yaml
  94. 93 cd ..
  95. 94 git clone https://github.com/sandervanvugt/ansiblecvc
  96. 95 cd ansiblecvc/kubernetes/
  97. 96 vim kube-cluster-setup.yaml
  98. 97 cd -
  99. 98 cd ansiblefundamentals/
  100. 99 vim run_and_test_httpd.yaml
  101. 100 ansible-playbook run_and_test_httpd.yaml
  102. 101 vim multi_play.yaml
  103. 102 ansible-doc -t help
  104. 103 ansible-doc -t inventory -l
  105. 104 ansible-doc -t inventory toml
  106. 105 less /usr/lib/python3.6/site-packages/ansible/plugins/inventory/toml.py
  107. 106 vim variables_example.yaml
  108. 107 ansible-playbook variables_example.yaml
  109. 108*
  110. 109 vim variables_example.yaml
  111. 110 ansible-doc user
  112. 111 ansible ansible1 -m setup | less
  113. 112 history
  114. 113 ansible-doc -l | grep facts
  115. 114 history
  116. 115 vim gather_facts.yaml
  117. 116 ansible-playbook gather_facts.yaml
  118. 117 history
  119. 118 ansible ansible1 -m setup | less
  120. 119 vim old_facts.yaml
  121. 120 ansible-playbook old_facts.yaml
  122. 121 vim new_facts.yaml
  123. 122 ansible-playbook new_facts.yaml
  124. 123 vim myvars.yaml
  125. 124 vim vars_file.yaml
  126. 125 ansible-playbook vars_file.yaml
  127. 126 vim vars_file.yaml
  128. 127 ansible-playbook vars_file.yaml
  129. 128 ls
  130. 129 mkdir localhost
  131. 130 rmdir localhost
  132. 131 mkdir host_vars
  133. 132 vim host_vars/localhost
  134. 133 vim myvars.yaml
  135. 134 vim vars_file.yaml
  136. 135 ansible-playbook vars_file.yaml
  137. 136 ls
  138. 137 vim vars_file.yaml
  139. 138 mkdir group_vars
  140. 139 vim group_vars/all
  141. 140 vim vars_file.yaml
  142. 141 ansible-playbook vars_file.yaml
  143. 142 vim register.yaml
  144. 143 ansible-playbook register.yaml
  145. 144 cat register.yaml
  146. 145 vim loop_packages.yaml
  147. 146 ansible-playbook loop_packages.yaml
  148. 147 vim loop_on_vars.yaml
  149. 148 cat vars/users-list
  150. 149 vim loop_on_vars.yaml
  151. 150 ansible-playbook loop_on_vars.yaml
  152. 151 vim when_test.yaml
  153. 152 lsblk
  154. 153 vim when_test.yaml
  155. 154 ansible-playbook when_test.yaml
  156. 155 vim when_register.yaml
  157. 156 ansible-playbook when_register.yaml
  158. 157 vim when_complex.yaml
  159. 158 ansible-playbook when_complex.yaml
  160. 159 cat using_handlers.yaml
  161. 160 vim using_handlers.yaml
  162. 161 ansible-playbook using_handlers.yaml
  163. 162 vim using_handlers.yaml
  164. 163 ansible-playbook using_handlers.yaml
  165. 164 ansible all -m file -a "name=/var/www/html/index.html state=absent"
  166. 165 ansible-playbook using_handlers.yaml
  167. 166 history
  168.  
Advertisement
Add Comment
Please, Sign In to add comment