Advertisement
sandervanvugt

ansible 3 weeks day 2 (only)

Oct 17th, 2023
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. [ansible@control filters]$ history
  2. 1 ip a
  3. 2 sudo vim /etc/hosts
  4. 3 ping ubuntu
  5. 4 sudo dnf install ansible-core
  6. 5 ansible --version
  7. 6 vim inventory
  8. 7 ansible -i inventory all -u student -k -b -K -m command -a "useradd ansible"
  9. 8 ssh student@ansile1
  10. 9 ssh student@ansible1
  11. 10 ssh student@ansible2
  12. 11 ssh student@ubuntu
  13. 12 ansible -i inventory all -u student -k -b -K -m command -a "useradd ansible"
  14. 13 ansible -i inventory all -u student -k -b -K -m user -a "name=ansible state=present"
  15. 14 history
  16. 15 ansible -i inventory all -u student -k -b -K -m shell "echo password | passwd --stdin ansible"
  17. 16 ansible -i inventory all -u student -k -b -K -m shell -a "echo password | passwd --stdin ansible"
  18. 17 sudo visudo
  19. 18 ansible -i inventory all -u student -k -b -K -m copy -a 'content="ansible ALL=(ALL) NOPASSWD: ALL" dest=/etc/sudoers.d/ansible'
  20. 19 ansible -i inventory all -u ansible -k -b -m command -a "ls -l /root"
  21. 20 sudo dnf install -y git
  22. 21 git clone https://github.com/sandervanvugt/ansiblein3weeks
  23. 22 history
  24. 23 cd ansiblein3weeks/
  25. 24 ls
  26. 25 cd basics/
  27. 26 ls
  28. 27 cd ..
  29. 28 vim ansible.cfg
  30. 29 cp ../inventory .
  31. 30 ansible all -k -a "ls -l /root"
  32. 31 ssh-keygen
  33. 32 ssh-copy-id ansible1
  34. 33 ssh-copy-id ansible2
  35. 34 ssh-copy-id ubuntu
  36. 35 history
  37. 36 exit
  38. 37 cd ansiblein3weeks/
  39. 38 ./countdown 13
  40. 39 ./countdown 1
  41. 40 ./countdown 18
  42. 41 ./countdown 13
  43. 42 cd ..
  44. 43 ./countdown 17
  45. 44 vim secureme.yml
  46. 45 ansible-playbook secureme.yml
  47. 46 ansible all -a "cat /etc/sudoers.d/ansible"
  48. 47 sudo visudo
  49. 48 ansible all -m copy -a "content='ansible ALL=(ALL) ALL' dest=/etc/sudoers.d/ansible"
  50. 49 ansible all -a 'ls /root'
  51. 50 ansible all -a 'ls /root' -K
  52. 51 ansible all -a 'ls /root'
  53. 52 ls
  54. 53 cd filters/
  55. 54 ls
  56. 55 cat storage-filter.yaml
  57. 56 vim storage-filter.yaml
  58. 57 ansible-playbook storage-filter.yaml
  59. 58 cp ../inventory .
  60. 59 ls
  61. 60 cp ../ansible.cfg .
  62. 61 ansible-galaxy collection install community.general
  63. 62 ansible-playbook storage-filter.yaml
  64. 63 vim inventory
  65. 64 ansible-playbook storage-filter.yaml
  66. 65 ansible-playbook storage-filter.yaml -K
  67. 66 vim storage-filter.yaml
  68. 67 ansible-playbook storage-filter.yaml -K
  69. 68 ansible ansible1 -m setup | less
  70. 69 vim int-filter.yaml
  71. 70 ansible-playbook int-filter.yaml
  72. 71 vim int-filter.yaml
  73. 72 ansible-playbook int-filter.yaml
  74. 73 vim int-filter.yaml
  75. 74 ansible-playbook int-filter.yaml
  76. 75 vim assert_filter.yaml
  77. 76 ansible-playbook assert_filter.yaml
  78. 77 vim assert_filter.yaml
  79. 78 ansible-playbook assert_filter.yaml
  80. 79 vim password_hash.yaml
  81. 80 ansible-playbook password_hash.yaml
  82. 81 history
  83.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement