Advertisement
sandervanvugt

ansible - setup commands

Mar 28th, 2023
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. [student@localhost ~]$ history
  2. 1 sudo vim /etc/hosts
  3. 2 ip a
  4. 3 sudo vim /etc/hosts
  5. 4 ping control
  6. 5 ping ansible1
  7. 6 ping ansible2
  8. 7 history
  9. 8 cat /etc/hosts
  10. 9 sudo dnf install ansible-core
  11. 10 history
  12. 11 ansible --version
  13. 12 ssh ansible1
  14. 13 ssh ansible2
  15. 14 nano inventory
  16. 15 cat inventory
  17. 16 ansible -i inventory all -u student -k -b -K -m command -a "useradd ansible"
  18. 17 ssh control
  19. 18 ansible -i inventory all -u student -k -b -K -m command -a "useradd ansible"
  20. 19 ansible -i inventory all -u student -k -b -K -m user -a "name=ansible"
  21. 20 ansible -i inventory all -u ansible -k -m command -a "whoami"
  22. 21 sudo sh -c "echo password | passwd --stdin ansible"
  23. 22 su - ansible
  24. 23 ansible -i inventory all -u student -k -b -K -m shell -a 'echo password | passwd --stdin ansible'
  25. 24 ansible -i inventory all -u ansible -k -m command -a "whoami"
  26. 25 ansible -i inventory all -u ansible -k -m command -a "ls -l /root"
  27. 26 ls -l /root
  28. 27 history
  29. 28 ansible -i inventory all -u student -k -b -K -m command -a "man -k user | grep 8"
  30. 29 ansible -i inventory all -u student -k -b -K -m shell -a "man -k user | grep 8"
  31. 30 history
  32. 31 ansible -i inventory all -m copy -a 'content="ansible ALL=(ALL) NOPASSWD: ALL" dest=/etc/sudoers.d/ansible'
  33. 32 ansible -i inventory all -u student -k -b -K -m copy -a 'content="ansible ALL=(ALL) NOPASSWD: ALL" dest=/etc/sudoers.d/ansible'
  34. 33 ansible -i inventory all -u ansible -k -b -m command -a "ls -l /root"
  35. 34 history
  36. 35 ssh-keygen
  37. 36 ssh-copy-id ansible1
  38. 37 ssh-copy-id ansible2
  39. 38 ssh-copy-id control
  40. 39 ansible -i inventory all -u ansible -b -m command -a "ls -l /root"
  41. 40 history
  42. 41 su -u
  43. 42 su -
  44. 43 su - ansible
  45. 44 ansible -i inventory all -u ansible -b -m command -a "ls -l /root"
  46. 45 su -
  47. 46 su - ansible
  48. 47 history
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement