Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat inv
- [test]
- 127.0.2.1
- $ ansible -i inv all -m ping
- The authenticity of host '127.0.2.1 (127.0.2.1)' can't be established.
- <...>
- Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
- [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
- https://docs.ansible.com/ansible-core/2.16/reference_appendices/interpreter_discovery.html for more information.
- 127.0.2.1 | SUCCESS => {
- "ansible_facts": {
- "discovered_interpreter_python": "/usr/bin/python3.12"
- },
- "changed": false,
- "ping": "pong"
- }
- $ cat >> ~/.ssh/config << EOF
- heredoc> Host 127.*
- heredoc> port 2222
- heredoc> EOF
- $ ansible -i inv all -m ping
- [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
- https://docs.ansible.com/ansible-core/2.16/reference_appendices/interpreter_discovery.html for more information.
- 127.0.2.1 | SUCCESS => {
- "ansible_facts": {
- "discovered_interpreter_python": "/usr/bin/python3.12"
- },
- "changed": false,
- "ping": "pong"
- }
- $ cat >| inv << EOF
- heredoc> [test]
- heredoc> 127.0.2.2
- heredoc> EOF
- $ ansible -i inv all -m ping
- 127.0.2.2 | UNREACHABLE! => {
- "changed": false,
- "msg": "Failed to connect to the host via ssh: ssh: connect to host 127.0.2.2 port 2222: Connection refused",
- "unreachable": true
- }
Advertisement
Add Comment
Please, Sign In to add comment