Advertisement
sandervanvugt

ansiblr4H jan24

Jan 8th, 2024
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.87 KB | None | 0 0
  1. [ansible@control ansiblefundamentals]$ history
  2. 1 ssh ansible1
  3. 2 ssh ansible2
  4. 3 cat > inventory
  5. 4 cat > inventory << EOF
  6. 5 ansible1
  7. 6 ansible2
  8. 7 EOF
  9. 8 cat inventory
  10. 9 ansible -i inventory all -u student -k -b -K -m command -a "useradd ansible"
  11. 10 ansible -i inventory all -u student -k -b -K -m shell -a "echo password | passwd --stdin ansible"
  12. 11 sudo dnf install -y git
  13. 12 git clone https://github.com/sandervanvugt/ansiblefundamentals
  14. 13 cd ansiblefundamentals/
  15. 14 ls
  16. 15 history
  17. 16 exit
  18. 17 history
  19. 18 ls
  20. 19 ansible -i inventory all -u ansible -k -m command -a "whoami"
  21. 20 ansible -i inventory all -u ansible -k -m command -a "ls -l /root"
  22. 21 ansible -i inventory all -m copy -a 'content="ansible ALL=(ALL) NOPASSWD: ALL" dest=/etc/sudoers.d/ansible'
  23. 22 ansible -i inventory all -u student -k -b -K -m copy -a 'content="ansible ALL=(ALL) NOPASSWD: ALL" dest=/etc/sudoers.d/ansible'
  24. 23 history
  25. 24 ansible -i inventory all -u ansible -k -b -m command -a "ls -l /root"
  26. 25 ansible -i inventory all -u ansible -b -m command -a "ls -l /root"
  27. 26 ssh-keygen
  28. 27 ssh-copy-id ansible1
  29. 28 ssh-copy-id ansible2
  30. 29 history
  31. 30 ssh ansible2
  32. 31 ansible -i inventory all -u ansible -b -m command -a "ls -l /root"
  33. 32 history
  34. 33 cat inventory
  35. 34 cd ansiblefundamentals/
  36. 35 ls
  37. 36 vim ansible.cfg
  38. 37 ansible ansible1 -a "whoami"
  39. 38 pwd
  40. 39 ls
  41. 40 cp ../inventory .
  42. 41 ansible ansible1 -a "whoami"
  43. 42 history
  44. 43 ansible-doc -l
  45. 44 ansible-doc copy
  46. 45 ansible all -m ping
  47. 46 ansible all -m user -a "name=lisa"
  48. 47 ansible all -m command -a "id lisa"
  49. 48 history
  50. 49 ansible all -m user -a "name=lisa state=absent"
  51. 50 ansible all -m command -a "id lisa"
  52. 51 ansible all -m copy -a "src=/etc/hosts dest=/etc/hosts"
  53. 52 history
  54. 53 ansible ansible1 -m command -a "rpm -qa | grep python"
  55. 54 ansible ansible1 -m shell -a "rpm -qa | grep python"
  56. 55 ansible all -m copy -a 'content="hello world" dest=/etc/motd'
  57. 56 ansible all -m package -a "name=nmap state=latest"
  58. 57 ansible all -m service -a "name=httpd state=started enabled=yes"
  59. 58 ansible-doc yum
  60. 59 ansible-doc package
  61. 60 ansible ansible1 -m command -a "useradd jason"
  62. 61 ansible ansible1 -m user -a "name=jason"
  63. 62 vim install_and_start_httpt.yaml
  64. 63 ansible-playbook install_and_start_httpt.yaml
  65. 64 vim install_and_start_httpt.yaml
  66. 65 vim inventory
  67. 66 vim install_and_start_httpt.yaml
  68. 67 ansible-playbook install_and_start_httpt.yaml
  69. 68 vim inventory
  70. 69 vim install_and_start_httpt.yaml
  71. 70 ansible-playbook install_and_start_httpt.yaml
  72. 71 ansible-playbook --syntax-check install_and_start_httpt.yaml
  73. 72 vim install_and_start_httpt.yaml
  74. 73 ansible-playbook -v install_and_start_httpt.yaml
  75. 74 ansible-playbook -vvvvv install_and_start_httpt.yaml
  76. 75 vim enforce-selinux.yml
  77. 76 ansible-playbook enforce-selinux.yml
  78. 77 ansible-doc -l | grep selinux
  79. 78 ansible-galaxy collection install ansible.posix
  80. 79 ansible-playbook enforce-selinux.yml
  81. 80 vim enforce-selinux.yml
  82. 81 ansible-playbook enforce-selinux.yml
  83. 82 vim enforce-selinux.yml
  84. 83 ansible-doc -l
  85. 84 vim enforce-selinux-simplified.yml
  86. 85 ansible-playbook enforce-selinux-simplified.yml
  87. 86 vim enforce-selinux-simplified.yml
  88. 87 sudo ls -l /root
  89. 88 ansible-playbook enforce-selinux-simplified.yml -K
  90. 89 history
  91. 90 ls
  92. 91 grep ftp *
  93. 92 vim lab4.yaml
  94. 93 ansible-doc service
  95. 94 vim lab4.yaml
  96. 95 ansible-doc | grep firewall
  97. 96 ansible-doc -l | grep firewall
  98. 97 ansible-doc firewalld
  99. 98 vim lab4.yaml
  100. 99 ansible-playbook lab4.yaml
  101. 100 vim lab4.yaml
  102. 101 ansible-playbook lab4.yaml
  103. 102 cat lab4.yaml
  104. 103 vim variables_example.yaml
  105. 104 ansible-playbook variables_example.yaml
  106. 105 vim variables_example.yaml
  107. 106 ansible-playbook variables_example.yaml
  108. 107 ansible-playbook variables_example.yaml -e user=linda
  109. 108 vim gather_facts.yaml
  110. 109 ansible-playbook gather_facts.yaml | less
  111. 110 vim old_facts.yaml
  112. 111 ansible-playbook old_facts.yaml
  113. 112 vim new_facts.yaml
  114. 113 vim loop_packages.yaml
  115. 114 ansible-playbook loop_packages.yaml
  116. 115 vim when_test.yaml
  117. 116 ansible-playbook when_test.yaml
  118. 117 vim when_complex.yaml
  119. 118 ansible-playbook when_complex.yaml
  120. 119 vim using_handlers.yaml
  121. 120 ansible-playbook using_handlers.yaml
  122. 121 ansible-playbook using_handlers.yaml -K
  123. 122 vim using_handlers.yaml
  124. 123 ansible-playbook using_handlers.yaml -K
  125. 124 ansible all -m file -a "name=/var/www/html/index.html state=absent"
  126. 125 ansible-playbook using_handlers.yaml -K
  127. 126 history
  128.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement