sandervanvugt

ans3W march22

Mar 14th, 2022
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.85 KB | None | 0 0
  1. ssh student@ansible2
  2. 7 ssh tower@ansible2
  3. 8 ssh student@tower
  4. 9 ssh student@ubuntu
  5. 10 mkdir setup
  6. 11 cd setup
  7. 12 vim inventory
  8. 13 sudo dnf install epel-release
  9. 14 sudo dnf install -y ansible
  10. 15 history
  11. 16 ansible --version
  12. 17 ansible -i inventory all -m user -a "name=ansible" -u student
  13. 18 ansible -i inventory all -m user -a "name=ansible" -u student -k
  14. 19 useradd ansible
  15. 20 useradd bob
  16. 21 sudo useradd student
  17. 22 sudo passwd student
  18. 23 ssh student@tower
  19. 24 ansible -i inventory all -m user -a "name=ansible" -u student -k
  20. 25 ansible -i inventory all -m user -a "name=ansible" -u student -k -b -K
  21. 26 sudo usermod -aG wheel student
  22. 27 ansible -i inventory all -m user -a "name=ansible" -u student -k -b -K
  23. 28 history
  24. 29 cd ..
  25. 30 sudo dnf -y git
  26. 31 sudo dnf install -y git
  27. 32 git clone https://github.com/sandervanvugt/luth
  28. 33 cd luth
  29. 34 ./countdown 12
  30. 35 #ansible -i inventory ubuntu -m shell -a 'echo "ansible:password" | chpasswd' -u student -b -k -K
  31. 36 cd ../setup/
  32. 37 ansible -i inventory ubuntu -m shell -a 'echo "ansible:password" | chpasswd' -u student -b -k -K
  33. 38 vim inventory
  34. 39 ansible -i inventory rhfamily -m shell -a "echo password | passwd --stdin ansible" -u root -k
  35. 40 cat inventory
  36. 41 ssh-keygen
  37. 42 historyt
  38. 43 history
  39. 44 ssh-copy-id
  40. 45 ssh-copy-id ansible1
  41. 46 ssh-copy-id ansible2
  42. 47 ssh-copy-id tower
  43. 48 ssh-copy-id ubuntu
  44. 49 ssh-copy-id control
  45. 50 history
  46. 51 ansible all -i inventory -m command -a "id" -u ansible
  47. 52 sudo visudo
  48. 53 ansible-doc copy
  49. 54 #ansible -i inventory ubuntu -m copy -a "content='ansible ALL=(ALL) ALL' dest=/etc/sudoers.d/ansible validate='/usr/bin/visudo -cd %S'" -u student -b -K
  50. 55 ansible-doc copy
  51. 56 ansible -i inventory ubuntu -m copy -a "content='ansible ALL=(ALL) ALL' dest=/etc/sudoers.d/ansible validate='/usr/bin/visudo -cf %S'" -u student -b -K
  52. 57 ansible -i inventory ubuntu -m copy -a "content='ansible ALL=(ALL) ALL' dest=/etc/sudoers.d/ansible validate='/usr/bin/visudo -cf %S'" -u student -b -k -K
  53. 58 ansible -i inventory ubuntu -m copy -a "content='ansible ALL=(ALL) ALL' dest=/etc/sudoers.d/ansible validate='/usr/bin/visudo -cf %s'" -u student -b -k -K
  54. 59 ansible -i inventory ubuntu -a "which visudo" -k -b -K -u student
  55. 60 ansible -i inventory ubuntu -m copy -a "content='ansible ALL=(ALL) ALL' dest=/etc/sudoers.d/ansible validate='/usr/sbin/visudo -cf %s'" -u student -b -k -K
  56. 61 ansible -i inventory ubuntu -a "id" -u ansible -b -K
  57. 62 history
  58. 63 ansible -i inventory rhfamily -m copy -a "content='ansible ALL=(ALL) ALL' dest=/etc/sudoers.d/ansible validate='/usr/sbin/visudo -cf %s'" -u student -b -k -K
  59. 64 cd ..
  60. 65 git clone https://github.com/sandervanvugt/ansiblein3weeks
  61. 66 cd ansiblein3weeks/
  62. 67 ls
  63. 68 history
  64. 69 vim ansible.cfg
  65. 70 ansible all -a "id"
  66. 71 cat ansible.cfg
  67. 72 sleep 120; ./countdown 10
  68. 73 ls
  69. 74 cd task_control/
  70. 75 ls
  71. 76 vim handlers.yml
  72. 77 echo hello > /tmp/index.html
  73. 78 ansible-playbook handlers.yml
  74. 79 pwd
  75. 80 cp ../../setup/inventory .
  76. 81 ansible-playbook handlers.yml
  77. 82 ls
  78. 83 cp ../ansible.cfg .
  79. 84 ansible-playbook handlers.yml
  80. 85 vim handlers.yml
  81. 86 history
  82. 87 ansible-playbook handlers.yml
  83. 88 ansible all -m file -a "name=/var/www/html/index.html state=absent"
  84. 89 ansible-playbook handlers.yml
  85. 90 vim handlers.yml
  86. 91 ansible all -m copy -a "src=/etc/hosts dest=/etc/hosts"
  87. 92 ansible-playbook handlers.yml
  88. 93 vim handlers.yml
  89. 94 ansible-playbook handlers.yml
  90. 95 ls
  91. 96 vim ifsize.yml
  92. 97 vim when_multiple.yml
  93. 98 ansible-playbook when_multiple.yml
  94. 99 vim when_multiple.yml
  95. 100 ansible-playbook when_multiple.yml
  96. 101 ls
  97. 102 cd ..
  98. 103 ls
  99. 104 vim register.yaml
  100. 105 ansible-playbook register.yaml
  101. 106 vim register.yaml
  102. 107 ansible-playbook register.yaml
  103. 108 ansible ubuntu -m command -a "useradd -m linda"
  104. 109 cp ../setup/inventory .
  105. 110 ls
  106. 111 vim ansible.cfg
  107. 112 ansible ubuntu -m command -a "useradd -m linda"
  108. 113 ansible ansible1 -m command -a "useradd -m linda"
  109. 114 ansible ansible1 -m user -a "name=linda"
  110. 115 ansible ansible1 -m user -a "name=linda state=absent"
  111. 116 ansible ansible1 -m user -a "name=linda"
  112. 117 ls
  113. 118 grep -R block *
  114. 119 vim setup.yaml
  115. 120 vim listing731.yaml
  116. 121 ansible-playbook listing731.yaml
  117. 122 vim listing731.yaml
  118. 123 ls
  119. 124 ./countdown 18
  120. 125 ansible --version
  121. 126 ansible-doc -l | grep docker
  122. 127 ansible-galaxy collection install community.docker
  123. 128 yum module list
  124. 129 history
  125.  
Advertisement
Add Comment
Please, Sign In to add comment