sandervanvugt

Untitled

Dec 3rd, 2021
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. [ansible@control ~]$ history
  2. 1 ip a
  3. 2 sudo vi /etc/hosts
  4. 3 cat /etc/hosts
  5. 4 sudo dnf install epel -y
  6. 5 sudo dnf install epel-release -y
  7. 6 sudo dnf install -y ansible
  8. 7 vim inventory
  9. 8 ping rocky
  10. 9 ping ubuntu
  11. 10 sudo vi /etc/hosts
  12. 11 ping ubuntu
  13. 12 ansible --version
  14. 13 sudo dnf install git -y
  15. 14 git clone https://github.com/sandervanvugt/ansibleinthreeweeks
  16. 15 cd ansibleinthreeweeks/
  17. 16 ls
  18. 17 git pull
  19. 18 ./countdown 12
  20. 19 sudo sh -c "echo password | passwd --stdin ansible"
  21. 20 echo ansible ALL=(ALL) NOPASSWD: ALL >/tmp/sudoers
  22. 21 echo "ansible ALL=(ALL) NOPASSWD: ALL" >/tmp/sudoers
  23. 22 cd ..
  24. 23 cat inventory
  25. 24 ansible rocky -i inventory -u root -k -m raw -a "useradd -G wheel ansible"
  26. 25 ssh root@rocky
  27. 26 ansible rocky -i inventory -u root -k -m raw -a "useradd -G wheel ansible"
  28. 27 ansible rocky -i inventory -u root -k -m command -a "id"
  29. 28 ansible rocky -i inventory -u root -k -m command -a "id ansible"
  30. 29 history
  31. 30 ansible rocky -i inventory -u root -k -m shell -a "echo password | passwd --stdin ansible"
  32. 31 ssh ansible@rocky
  33. 32 ansible rocky -i inventory -u root -k -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  34. 33 ansible rocky -u ansible -k -i inventory -m command -a "ls -l /root"
  35. 34 ansible rocky -u ansible -k -i inventory -b -m command -a "ls -l /root"
  36. 35 ssh-keygen
  37. 36 ssh-copy-id rocky
  38. 37 ansible rocky -u ansible -i inventory -b -m command -a "ls -l /root"
  39. 38 history
  40. 39 #ansible ubuntu -i inventory -u student -k -b -K -m command -a "useradd -G sudo ansible"
  41. 40 ssh student@ubuntu
  42. 41 #ansible ubuntu -i inventory -u student -k -b -K -m command -a "useradd -m -G sudo ansible"
  43. 42 ansible ubuntu -i inventory -u student -k -b -K -m command -a "useradd -m -G sudo ansible"
  44. 43 ansible ubuntu -i inventory -u ansible -k -b -K -m command -a "ls /root"
  45. 44 ansible ubuntu -i inventory -u student -k -b -K -m shell -a "echo ansible:password | chpasswd"
  46. 45 ansible ubuntu -i inventory -u ansible -k -b -K -m command -a "ls /root"
  47. 46 ansible ubuntu -i inventory -u ansible -k -b -K -m command -a "ls -a /root"
  48. 47 ssh-copy-id ubuntu
  49. 48 ansible ubuntu -i inventory -u ansible -b -K -m command -a "ls -a /root"
  50. 49 ansible ubuntu -i inventory -u ansible -b -K -m copy -a "src=/tmp/sudoers dest=/etc/sudoers.d/ansible"
  51. 50 ansible ubuntu -i inventory -u ansible -m command -a "ls -a /root"
  52. 51 ansible ubuntu -i inventory -u ansible -b -m command -a "ls -a /root"
  53. 52 history
  54.  
Advertisement
Add Comment
Please, Sign In to add comment