Hi, i am trying to use network_cli with ssh transport and with a jumphost and it does not work: ansible_ssh_common_args is ignored. i have tried with paramiko and libssh . my goal is to use the bigip_command module. i have tried the standard one in ansible 2.9/2.10 and also in external collection. here i report about the standard one in 2.9/2.10. Here is the table of my tests:
Python | Ansible | ssh lib | ansible_connection | ansible_network_os | JH | result |
2.7.5 | 2.9.25 | Paramiko 2.1.1 | network_cli | bigip | no | ConnectionError: Error reading SSH protocol banner |
2.7.5 | 2.9.24 | Paramiko 2.10.3 | network_cli | bigip | no | OK ! |
2.7.5 | 2.9.24 | Paramiko 2.10.3 | network_cli | bigip | yes | proxycommand ignored … KO ! |
2.7.5 | 2.9.24 | Ansible-pylibssh 0.3.0 | network_cli | bigip | no | OK ! |
2.7.5 | 2.9.24 | Ansible-pylibssh 0.3.0 | network_cli | bigip | yes | proxycommand ignored … KO ! |
2.7.5 | 2.10 | Paramiko 2.10.3 | network_cli | bigip | no | "missing required arguments: password, user found in provider" |
2.7.5 | 2.10 | Ansible-pylibssh 0.3.0 | network_cli | bigip | no | ConnectionError: command timeout triggered, timeout value is 30 secs |
3.6.8 | 2.9.24 | Paramiko 2.10.3 | network_cli | bigip | no | OK ! |
3.6.8 | 2.9.24 | Ansible-pylibssh 0.3.0 | network_cli | bigip | no | OK ! |
3.6.8 | 2.10 | Paramiko 2.10.3 | network_cli | bigip | no | "missing required arguments: password, user found in provider" |
3.6.8 | 2.10 | Ansible-pylibssh 0.3.0 | network_cli | bigip | no | ansible.module_utils.connection.ConnectionError: command timeout triggered, timeout value is 30 secs. |
3.8 | 2.10 | Paramiko 2.10.3 | network_cli | bigip | no | "missing required arguments: password, user found in provider" |
3.8 | 2.10 | Ansible-pylibssh 0.3.0 | network_cli | bigip | no | connected and wait …. |
how to tell paramiko or libssh to use the ansible_ssh_common_args variable? i can't use the ssh/config file to declare a proxy so all must be set in ansible.... part of my code:
part of my inventory:
Regards, -- ----------------- Gaétan Only doctor Who can reboot the universe.
Hi,
thanks for your answer.
i have set the variable this way:
and there is no trace in ansible logs that ansible is trying to
use this variable, no proxy connect attempts.
shouldn't there be information in debug log ?
Regards,
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f5cb1ae8-9819-4966-b464-1dc176038bfdn%40googlegroups.com.
sorry i have said something wrong. i don't see anything in ouput but in log i can see that:
regards,
in fact, even a direct cli_command call without bigip_command give the same pb:
logs:
2022-03-30 11:29:11,241 p=3199 u=da_ansible n=ansible | Using
module_utils file
/home/da_ansible/venv-ansible-2.9-python-2.7/lib/python2.7/site-packages/ansible/module_utils/common/json.py
2022-03-30 11:29:11,244 p=3199 u=da_ansible n=ansible | Using
module file
/home/da_ansible/.ansible/collections/ansible_collections/ansible/netcommon/plugins/modules/cli_command.py
2022-03-30 11:29:11,245 p=3199 u=da_ansible n=ansible |
<172.16.99.23> PUT
/home/da_ansible/.ansible/tmp/ansible-local-3190zeYu5Z/tmp8EZd8f
TO
/home/da_ansible/.ansible/tmp/ansible-local-3190zeYu5Z/ansible-tmp-1648639751.15-3199-151113274687612/AnsiballZ_cli_command.py
2022-03-30 11:29:11,245 p=3199 u=da_ansible n=ansible |
<172.16.99.23> EXEC /bin/sh -c 'chmod u+x
/home/da_ansible/.ansible/tmp/ansible-local-3190zeYu5Z/ansible-tmp-1648639751.15-3199-151113274687612/
/home/da_ansible/.ansible/tmp/ansible-local-3190zeYu5Z/ansible-tmp-1648639751.15-3199-151113274687612/AnsiballZ_cli_command.py
&& sleep 0'
2022-03-30 11:29:11,250 p=3199 u=da_ansible n=ansible |
<172.16.99.23> EXEC /bin/sh -c 'python
/home/da_ansible/.ansible/tmp/ansible-local-3190zeYu5Z/ansible-tmp-1648639751.15-3199-151113274687612/AnsiballZ_cli_command.py
&& sleep 0'
2022-03-30 11:29:11,317 p=3207 u=da_ansible n=ansible | jsonrpc
request: {"params": [[], {"sendonly": false, "prompt": null,
"check_all": false, "newline": true, "command": "show version",
"answer": null}], "jsonrpc": "2.0", "method": "get", "id":
"d73d563d-74a9-4a55-aad7-997e7372ec3d"}
2022-03-30 11:29:11,318 p=3207 u=da_ansible n=ansible | jsonrpc
response: {"jsonrpc": "2.0", "id":
"d73d563d-74a9-4a55-aad7-997e7372ec3d", "error": {"message":
"Method not found", "code": -32601}}
2022-03-30 11:29:11,323 p=3199 u=da_ansible n=ansible |
<172.16.99.23> EXEC /bin/sh -c 'rm -f -r
/home/da_ansible/.ansible/tmp/ansible-local-3190zeYu5Z/ansible-tmp-1648639751.15-3199-151113274687612/
> /dev/null 2>&1 && sleep 0'
2022-03-30 11:29:11,331 p=3190 u=da_ansible n=ansible | The full
traceback is:
WARNING: The below traceback may *not* be related to the actual
failure.
File
"/tmp/ansible_ansible.netcommon.cli_command_payload_oPK79G/ansible_ansible.netcommon.cli_command_payload.zip/ansible_collections/ansible/netcommon/plugins/modules/cli_command.py",
line 169, in main
File
"/tmp/ansible_ansible.netcommon.cli_command_payload_oPK79G/ansible_ansible.netcommon.cli_command_payload.zip/ansible/module_utils/connection.py",
line 185, in __rpc__
raise ConnectionError(to_text(msg,
errors='surrogate_then_replace'), code=code)
2022-03-30 11:29:11,331 p=3190 u=da_ansible n=ansible | fatal:
[labkvmbigip-direct]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"answer": null,
"check_all": false,
"command": "show version",
"newline": true,
"prompt": null,
"sendonly": false
}
},
"msg": "Method not found"
}