I’m trying to have Ansible use an alternate ssh config file (i.e. not ~/.ssh/config).
My understanding was that you achieve this via adding a -F option in ssh_args in /etc/ansible/ansible.cfg. So my ssh_args now looks like this:
[ssh_connection]
ssh_args = -C -F ~/.ssh/collated-configs -o ControlMaster=auto -o ControlPersist=30m -o ControlPath=/tmp/ansible-ssh-%h-%p-%r
but collated-configs never gets referenced.
Any thoughts appreciated.
Jeff
sivel
(sivel)
2
Jeff,
If memory serves me correctly, you have to use a full path to the config, and cannot use ~
This is due to the ssh command not being executed via a shell, so shell expansions do not happen.
I have a similar configuration in my ansible.cfg and it works without issue.
Hey Matt,
Tried it both ways, makes no difference.
With verbosity cranked up, I can see that it’s reading the default .ssh/config file.
But interestingly, although the debug does show:
“Using /etc/ansible/ansible.cfg as config file”
and that contains:
ssh_args = -C -F /home/user01/.ssh/collated-configs -o ControlMaster=auto -o Co
st=30m -o ControlPath=/tmp/ansible-ssh-%h-%p-%r
the SSH: debug does not reflect any of those ssh_args.
So if we’re not reading /etc/ansible/ansible.cfg at all, that would explain this behavior. But what would cause that to silently fail?
Jeff