# ControlMaster settings not taking affect

**URL:** <https://forum.ansible.com/t/controlmaster-settings-not-taking-affect/15285>\
**Category:** Ansible Project\
**Created:** [May 21, 2014, 5:20am UTC](https://forum.ansible.com/t/controlmaster-settings-not-taking-affect/15285 "2014-05-21T05:20:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_Hurrell](https://avatars.discourse-cdn.com/v4/letter/g/76d3ee/32.png) [@Greg\_Hurrell](https://forum.ansible.com/u/Greg_Hurrell)\
**Post date:** [May 21, 2014, 5:20am UTC](https://forum.ansible.com/t/controlmaster-settings-not-taking-affect/15285/1 "2014-05-21T05:20:33Z")

</div>

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](http://docs.ansible.com/intro_configuration.html), 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

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [May 21, 2014, 2:40pm UTC](https://forum.ansible.com/t/controlmaster-settings-not-taking-affect/15285/2 "2014-05-21T14:40:11Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Greg\_Hurrell](https://avatars.discourse-cdn.com/v4/letter/g/76d3ee/32.png) [@Greg\_Hurrell](https://forum.ansible.com/u/Greg_Hurrell)\
**Post date:** [May 21, 2014, 2:54pm UTC](https://forum.ansible.com/t/controlmaster-settings-not-taking-affect/15285/3 "2014-05-21T14:54:08Z")

</div>

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. ☹

-Greg

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [May 21, 2014, 4:49pm UTC](https://forum.ansible.com/t/controlmaster-settings-not-taking-affect/15285/4 "2014-05-21T16:49:09Z")

</div>

No problem, let us know if it reoccurs.

Thanks!
