# ssh.config through ansible.cfg behaves differently then ssh.config direct

**URL:** <https://forum.ansible.com/t/ssh-config-through-ansible-cfg-behaves-differently-then-ssh-config-direct/20450>\
**Category:** Ansible Project\
**Created:** [February 4, 2016, 1:58pm UTC](https://forum.ansible.com/t/ssh-config-through-ansible-cfg-behaves-differently-then-ssh-config-direct/20450 "2016-02-04T13:58:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jurgen\_Coetsiers](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@Jurgen\_Coetsiers](https://forum.ansible.com/u/Jurgen_Coetsiers)\
**Post date:** [February 4, 2016, 1:58pm UTC](https://forum.ansible.com/t/ssh-config-through-ansible-cfg-behaves-differently-then-ssh-config-direct/20450/1 "2016-02-04T13:58:04Z")

</div>

Hi,

My ssh.config

Host bastion  
User ansible  
HostName bastion-server  
ProxyCommand none  
IdentityFile ~/.ssh/id\_rsa  
BatchMode yes  
PasswordAuthentication no

Host \*  
ServerAliveInterval 60  
TCPKeepAlive yes  
ProxyCommand ssh -q -A root@bastion nc %h %p  
ControlMaster auto  
ControlPath ~/.ssh/mux-%r@%h:%p  
ControlPersist 8h  
User root  
StrictHostKeyChecking no

My ansible.cfg

[default]  
hash\_behaviour=merge  
transport=ssh

[ssh\_connection]  
ssh\_args = -o ControlPersist=15m -F ssh.config -q  
scp\_if\_ssh = True  
control\_path = ~/.ssh/mux-%%r@%%h:%%p

When I run ssh bastion -F ssh.config I can connect with success.

When I run ansible -i ./ meta\_Pool\_wearezoneeu -m setup -vvvv it gives following error:

ERROR! ERROR! ./ssh.config:1: Expected key=value host variable assignment, got: bastion

No idea why this happens. Anyone experienced a similar thing or can point me into the right direction?
