# Ansible 2.2 not respecting ssh.cfg

**URL:** <https://forum.ansible.com/t/ansible-2-2-not-respecting-ssh-cfg/24712>\
**Category:** Ansible Project\
**Created:** [June 13, 2017, 2:55pm UTC](https://forum.ansible.com/t/ansible-2-2-not-respecting-ssh-cfg/24712 "2017-06-13T14:55:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![barrett](https://avatars.discourse-cdn.com/v4/letter/b/54ee81/32.png) [@barrett](https://forum.ansible.com/u/barrett)\
**Post date:** [June 13, 2017, 2:55pm UTC](https://forum.ansible.com/t/ansible-2-2-not-respecting-ssh-cfg/24712/1 "2017-06-13T14:55:36Z")

</div>

I am using a dynamic inventory. The build inventory returns hosts vars with the following

inventory\_hostname= jenkins-0.build.vnet  
ansible\_host=y.y.y.y (There are private ips)

I also have  
x.x.x.x = The public ip of the jump box

I have the following in my ssh.cfg which is referenced in my ansible.cfg

```auto
Host build-bastion
    HostName x.x.x.x
    ForwardAgent yes

```

```auto
Host *.build.vnet
    ProxyCommand ssh build-bastion -W %h:%p

```

This does not work and I get an “unreachable” error.

If remove the dynamic inventory entirely and do the following in my static inventory

```auto
[build-jenkins]

```

```auto
jenkins-0.build.vnet ansible_host=y.y.y.y

```

It still does not work

However, the below does work.

```auto
[build-jenkins]

```

```auto
jenkins-0.build.vnet ansible_host=y.y.y.y ansible_ssh_common_args=' -o ProxyCommand="ssh -W %h:%p x.x.x.x"'

```

In fact, if I run the hardcoded static version, then remove it and use the dynamic version, it works. I assume because of connection caching.

I cannot set the args global, because we have different boxes for different customers and environments.

-b
