ControlMaster settings not taking affect

Hi,

I’ve noticed that Ansible isn’t using ControlMaster in my local setup, making it slower than it needs to be.

This is Ansible 1.6.1, running on OS X 10.9.3 and connecting to remote hosts running CentOS 6.

If I connect to the remote host and tail -f /var/log/secure I can see tell-tale Accepted publickey for ec2-user entries getting added over and over again during Ansible runs.

I tried overriding the ssh_connection ssh_args setting to specify a specific ControlMaster path as suggested in the docs, but the only thing that works is setting up a specific entry in ~/.ssh/config for the hosts I’m connecting to with (something like):

Host *

ControlMaster auto
ControlPath ~/.ssh/%r@%h:%p
ControlPersist 240

Any ideas why not this explicit set-up in ansible.cfg has any effect?

[ssh_connection]
ssh_args = -vvvv -o ControlMaster=auto -o ControlPersist=60s

control_path = %(directory)s/%%h-%%r

You should not need to specify those extra ssh_args if you’re using the ssh transport and your system supports ControlPersist. Can you gist/pastebin the output of a test run using -vvvvv to see any additional SSH debugging information available?

Alas, the problem went away. On running ansible-playbook with -vvvv, I could see the right Control* options getting used, and /var/log/secure no longer showed any re-auths.

Sorry for the noise. :frowning:

-Greg

No problem, let us know if it reoccurs.

Thanks!