sandervanvugt

RHCE-oct20-day1

Oct 5th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. RUN AS ROOT 1 free -m
  2. 2 lsblk
  3. 3 cat /etc/redhat-release
  4. 4 vim /etc/hosts
  5. 5 yum install -y vim bash-completion git
  6. 6 vim /etc/hosts
  7. 7 ping ansible1
  8. 8 ping ansible2
  9. 9 yum install -y epel-release
  10. 10 yum install -y ansible
  11. 11 history
  12. 12 echo "ansible ALL=(ALL) NOPASSWD: ALL"> /etc/sudoers.d/ansible
  13. 13 ssh ansible1 'echo "ansible ALL=(ALL) NOPASSWD: ALL"> /etc/sudoers.d/ansible'
  14. 14 ssh ansible2 'echo "ansible ALL=(ALL) NOPASSWD: ALL"> /etc/sudoers.d/ansible'
  15.  
  16. RUN AS ANSIBLE ON CONTROL 1 ssh-keygen
  17. 2 ssh-copy-id ansible1
  18. 3 ssh-copy-id ansible2
  19. 4 history 5 ansible --version
  20. 6 git clone https://github.com/sandervanvugt/rhce8-live
  21. 7 git clone https://github.com/sandervanvugt/rhce8-book
  22. 8 ls
  23. 9 cd rhce8-live/
  24. 10 ls
  25. 11 ./countdown 12
  26. 12 sudo vim /etc/ansible/hosts
  27. 13 sudo vim /etc/ansible/ansible.cfg
  28. 14 ansible -i inventory all --list-hosts
  29. 15 ls
  30. 16 cd lesson2/
  31. 17 ls
  32. 18 cat inventory
  33. 19 ansible -i inventory all --list-hosts
  34. 20 ansible web --list-hosts
  35. 21 ansible -i inventory ungrouped --list-hosts
  36. 22 vim ansible.cfg
  37. 23 ls
  38. 24 ls -l
  39. 25 mv inventory /tmp
  40. 26 mkdir inventory
  41. 27 mv /tmp/inventory inventory/
  42. 28 grep inventory ansible.cfg
  43. 29 ansible --version
  44. 30 ansible all -m user -a "name=lisa"
  45. 31 ansible all -m command -a "id lisa"
  46. 32 ansible -m command -a "useradd lisa"
  47. 33 ansible all -m command -a "useradd lisa"
  48. 34 ansible all -m user -a "name=lisa"
  49. 35 history
  50. 36 ansible ansible1.example.com -m command -a "rpm -qa | grep nmap"
  51. 37 ansible ansible1.example.com -m shell -a "rpm -qa | grep nmap"
  52. 38 ansible all -m ping
  53. 39 ansible all -m service -a "name=httpd state=started"
  54. 40 ansible all -m copy -a 'content="hello world" dest=/etc/motd"
  55. 41 ansible all -m copy -a 'content="hello world" dest=/etc/motd'
  56. 42 ansible all -a "cat /etc/motd"
  57. 43 history
  58. 44 ../countdown 12
  59. 45 vim inventory/
  60. 46 history
  61. 47 ansible all -a "cat /etc/motd"
  62. 48 ansible-doc -l
  63. 49 ansible-doc -l | wc
  64. 50 ansible-doc -l | grep '^ios'
  65. 51 ansible-doc -l | grep '^ios' | wc
  66. 52 ansible-doc user
  67. 53 ansible -u root -i inventory ansible2.example.com --ask-pass -m raw -a "yum install -y python3"
  68. 54 vim ~/.vimrc
  69. 55 cd ../lesson4/
  70. 56 ls
  71. 57 vim vsftpd.yml
  72. 58 vim ~/.vimrc
  73. 59 vim vsftpd.yml
  74. 60 ansible-playbook vsftpd.yml
  75. 61 vim vsftpd.yml
  76. 62 ansible-playbook vsftpd.yml
  77. 63 vim vsftpd.yml
  78. 64 ansible-playbook vsftpd.yml
  79. 65 vim vsftpd.yml
  80. 66 ansible-playbook vsftpd.yml
  81. 67 ansible-playbook --syantax-check vsftpd.yml
  82. 68 ansible-playbook vsftpd.yml --syntax-check
  83. 69 vim vsftpd.yml
  84. 70 ansible-playbook -v vsftpd.yml
  85. 71 ansible-playbook -vvvv vsftpd.yml
  86. 72 vim web-setup-and-test.yml
  87. 73 ansible-playbook web-setup-and-test.yml
  88. 74 ../countdown 12
  89. 75 ansible ansible1.example.com -m setup > ../lesson5/facts.txt
  90. 76 cd ../lesson5/
  91. 77 less facts.txt
  92. 78 ansible-doc -l | grep facts | less
  93. 79 ansible-doc -l | grep facts | wc
  94. 80 ls
  95. 81 vim user.yml
  96. 82 ansible-playbook user.yml
  97. 83 ansible-playbook --help
  98. 84 ansible-playbook user.yml -e user=anna
  99. 85 vim user.yml
  100. 86 ansible-playbook user.yml
  101. 87 vim user.yml
  102. 88 ansible-playbook user.yml
  103. 89 ls
  104. 90 history | grep git
  105. 91 cd webservers/
  106. 92 ls
  107. 93 cat inventory
  108. 94 cat ansible.cfg
  109. 95 ls group_vars/
  110. 96 cat inventory
  111. 97 ls
  112. 98 cat group_vars/lamp
  113. 99 vim site.yml
  114. 100 ansible-playbook site.yml
  115. 101 history
  116.  
Add Comment
Please, Sign In to add comment