Guest User

Untitled

a guest
May 22nd, 2024
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. $ cat inv
  2. [test]
  3. 127.0.2.1
  4. $ ansible -i inv all -m ping
  5. The authenticity of host '127.0.2.1 (127.0.2.1)' can't be established.
  6. <...>
  7. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
  8. [WARNING]: Platform linux on host 127.0.2.1 is using the discovered Python interpreter at /usr/bin/python3.12, but future installation of another Python interpreter could change the meaning of that path. See
  9. https://docs.ansible.com/ansible-core/2.16/reference_appendices/interpreter_discovery.html for more information.
  10. 127.0.2.1 | SUCCESS => {
  11. "ansible_facts": {
  12. "discovered_interpreter_python": "/usr/bin/python3.12"
  13. },
  14. "changed": false,
  15. "ping": "pong"
  16. }
  17. $ cat >> ~/.ssh/config << EOF
  18. heredoc> Host 127.*
  19. heredoc> port 2222
  20. heredoc> EOF
  21. $ ansible -i inv all -m ping
  22. [WARNING]: Platform linux on host 127.0.2.1 is using the discovered Python interpreter at /usr/bin/python3.12, but future installation of another Python interpreter could change the meaning of that path. See
  23. https://docs.ansible.com/ansible-core/2.16/reference_appendices/interpreter_discovery.html for more information.
  24. 127.0.2.1 | SUCCESS => {
  25. "ansible_facts": {
  26. "discovered_interpreter_python": "/usr/bin/python3.12"
  27. },
  28. "changed": false,
  29. "ping": "pong"
  30. }
  31. $ cat >| inv << EOF
  32. heredoc> [test]
  33. heredoc> 127.0.2.2
  34. heredoc> EOF
  35. $ ansible -i inv all -m ping
  36. 127.0.2.2 | UNREACHABLE! => {
  37. "changed": false,
  38. "msg": "Failed to connect to the host via ssh: ssh: connect to host 127.0.2.2 port 2222: Connection refused",
  39. "unreachable": true
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment