This fixed the problem mentioned in the question (problems still exist with the ssh connection, but that's for another question).
By default, ansible adds some options which override ssh_config
options. Specifically, it adds:
-o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/devel/.ansible/cp/ansible-ssh-%h-%p-%r"
Figured that out by using -vvv
with ansible-playbook
.
You can fix / override those options by specifying ssh_args
in the [ssh_connection]
section of your .ansible.cfg
as specified here. Also worth noting is that, counter to what you might infer from the name, changing ssh_args
doesn't actually change all of the args. Ansible also passes -C -tt -v -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o ConnectTimeout=10
and other options (e.g. -o PasswordAuthentication=no -o User=root
), some of which are simply immutable defaults, and some of which depend on variables you've specified in the playbook.