Advertisement
sandervanvugt

ansible setup

Oct 10th, 2023
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. [student@localhost ~]$ history
  2. 1 free -m
  3. 2 sudo hostnamectl set-hostname control.example.com
  4. 3 exit
  5. 4 sudo hostnamectl set-hostname control.example.com
  6. 5 su -
  7. 6 su - ansible
  8. 7 history
  9. [student@localhost ~]$ su - ansible
  10. Password:
  11. [ansible@control ~]$ history
  12. 1 ip a
  13. 2 sudo vim /etc/hosts
  14. 3 ping ubuntu
  15. 4 sudo dnf install ansible-core
  16. 5 ansible --version
  17. 6 vim inventory
  18. 7 ansible -i inventory all -u student -k -b -K -m command -a "useradd ansible"
  19. 8 ssh student@ansile1
  20. 9 ssh student@ansible1
  21. 10 ssh student@ansible2
  22. 11 ssh student@ubuntu
  23. 12 ansible -i inventory all -u student -k -b -K -m command -a "useradd ansible"
  24. 13 ansible -i inventory all -u student -k -b -K -m user -a "name=ansible state=present"
  25. 14 history
  26. 15 ansible -i inventory all -u student -k -b -K -m shell "echo password | passwd --stdin ansible"
  27. 16 ansible -i inventory all -u student -k -b -K -m shell -a "echo password | passwd --stdin ansible"
  28. 17 sudo visudo
  29. 18 ansible -i inventory all -u student -k -b -K -m copy -a 'content="ansible ALL=(ALL) NOPASSWD: ALL" dest=/etc/sudoers.d/ansible'
  30. 19 ansible -i inventory all -u ansible -k -b -m command -a "ls -l /root"
  31. 20 sudo dnf install -y git
  32. 21 git clone https://github.com/sandervanvugt/ansiblein3weeks
  33. 22 history
  34. 23 cd ansiblein3weeks/
  35. 24 ls
  36. 25 cd basics/
  37. 26 ls
  38. 27 cd ..
  39. 28 vim ansible.cfg
  40. 29 cp ../inventory .
  41. 30 ansible all -k -a "ls -l /root"
  42. 31 ssh-keygen
  43. 32 ssh-copy-id ansible1
  44. 33 ssh-copy-id ansible2
  45. 34 ssh-copy-id ubuntu
  46. 35 history
  47. 36 exit
  48. 37 history
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement