While running Playbook Ansible is not using the Proxy

I have setup Ansible in Win 11 via WSL.

  • I have configured the Proxy setting:
    ** Config of my host file:
    [remote_node]
    remote-node-1 ansible_host=10.10.10.1

    [remote_node:vars]
    ansible_ssh_common_args=‘-o ProxyJump=jump-server’
    ansible_connection=network_cli
    ansible_network_os=ios

** .ssh/config:
Host jump-server
HostName 172.25.25.25
User MYDOMAIN\user_jump

Host remote-node-1
HostName 10.10.10.10
User user_node
ProxyJump jump-server

Config of Playbook:

  • name: Manage node
    hosts: remote_node
    gather_facts: false
    tasks:
    • name: Testing to check the version
      ansible.netcommon.cli_command:
      command: show version

~/myansible$ ansible-playbook -i inventories/network/hosts playbooks/manage-node.yml -vvv

  • While debugging the connectivity in the network firewall log I have seen Ansible is directly trying to access the remote node.
  • To Access the remote node it has to use the proxy Jump server

Can you please help to fix this problem to use the proxy while running the playbook

Assuming you are using ansible_ssh_type of libssh, the default is auto so you may need to inspect your logs to check for paramiko in your environment.

If it’s libssh you need to look at:

Try using the variable ansible_paramiko_proxy_command instead of ansible_ssh_common_args. If you don’t have ansible-pylibssh installed, ansible.netcommon.network_cli will use ansible.builtin.paramiko by default, which doesn’t use the variable ansible_ssh_common_args in ansible-core >=2.18.

I noticed a bunch of outdated networking examples: Update networking jumphost examples by s-hertel · Pull Request #2586 · ansible/ansible-documentation · GitHub.

If that’s not the issue, sharing the output with -vvvv would be useful.

1 Like