title: Ansible : SSH Error: ControlPath too long
body: <p>I run a computer with <code>Ubuntu 15.10</code> and I try to run <code>Vagrant</code> with <code>Ansible</code>.</p>
  
  <p>Before start, I like to say that I don't have any idea about server management and especialy the <code>Ansible</code>.</p>
  
  <p>The reason I am going to run my system this way, is because I have start working on a project that requires this installation.</p>
  
  <p>After all, the problem I have is that while provisioning the <code>Vagrant</code> I get the following message</p>
  
  <pre><code>&lt;aaa.dev&gt; ESTABLISH CONNECTION FOR USER: vagrant
  &lt;aaa.dev&gt; REMOTE_MODULE setup
  &lt;aaa.dev&gt; EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o IdentityFile=/media/merianos/Large Internal/Vagrant/ansible-project/.vagrant/machines/default/virtualbox/private_key -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/merianos/.ansible/cp/%h-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=30 aaa.dev /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1446622406.54-199921739516776 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1446622406.54-199921739516776 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1446622406.54-199921739516776'
  fatal: [aaa.dev] =&gt; SSH Error: ControlPath too long
  It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
  </code></pre>
  
  <p>So, is it posible to help me someone with this issue ?</p>
  
  <p>Just to say that I have try this article : <a href="https://github.com/ansible/ansible/issues/11536" rel="nofollow">https://github.com/ansible/ansible/issues/11536</a> and I changed the <code>control_path</code> in my <code>ansible.cfg</code> to <code>control_path = %(directory)s/%%h-%%r</code> but still not working.</p>
  
  <p><em>Note</em> My installation path contains a space that I can't remove it because are running many other projects on the same HDD and the configuration will be huge for all the projects. I don't know if that space is the problem, but just I say about it.</p>
  
  <p><strong>UPDATE #1</strong></p>
  
  <p>Result before I change anything:</p>
  
  <pre><code>&lt;aaa.dev&gt; ESTABLISH CONNECTION FOR USER: vagrant
  &lt;aaa.dev&gt; REMOTE_MODULE setup
  &lt;aaa.dev&gt; EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o IdentityFile=/media/merianos/Large Internal/Vagrant/ansible-project/.vagrant/machines/default/virtualbox/private_key -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/merianos/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=30 aaa.dev /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1446628138.53-155680153347939 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1446628138.53-155680153347939 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1446628138.53-155680153347939'
  fatal: [aaa.dev] =&gt; SSH Error: ControlPath too long
  It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
  </code></pre>
  
  <p>Result with <code>control_path  = %(directory)s/%%h-%%r</code> :</p>
  
  <pre><code>&lt;aaa.dev&gt; ESTABLISH CONNECTION FOR USER: vagrant
  &lt;aaa.dev&gt; REMOTE_MODULE setup
  &lt;aaa.dev&gt; EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o IdentityFile=/media/merianos/Large Internal/Vagrant/ansible-project/.vagrant/machines/default/virtualbox/private_key -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/merianos/.ansible/cp/%h-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=30 aaa.dev /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1446628320.4-231606404275563 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1446628320.4-231606404275563 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1446628320.4-231606404275563'
  fatal: [aaa.dev] =&gt; SSH Error: ControlPath too long
  It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
  </code></pre>
  
  <p><strong>UPDATE #2</strong></p>
  
  <p>After I set the <code>ssh_args = -o ControlMaster=off</code> I get the following result:</p>
  
  <pre><code>&lt;aaa.dev&gt; ESTABLISH CONNECTION FOR USER: vagrant
  &lt;aaa.dev&gt; REMOTE_MODULE setup
  &lt;aaa.dev&gt; EXEC ssh -C -tt -vvv -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o IdentityFile=/media/merianos/Large Internal/Vagrant/ansible-project/.vagrant/machines/default/virtualbox/private_key -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/merianos/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=30 aaa.dev /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1446628489.4-10074395967553 &amp;&amp; chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1446628489.4-10074395967553 &amp;&amp; echo $HOME/.ansible/tmp/ansible-tmp-1446628489.4-10074395967553'
  fatal: [aaa.dev] =&gt; SSH Error: ControlPath too long
  It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
  </code></pre>
  
  <p>In general for each modification I did, the error message seems to be the same, and maybe the configuration it happens from some other level, but not the <code>ansible.cfg</code>.</p>
  
  <p>Unfortunatelly I don't know where to find that location :(</p>