Is changing my ControlPath causing misdirected commands?

53 views
Skip to first unread message

Larry Fast

unread,
Aug 14, 2015, 6:30:01 PM8/14/15
to Ansible Project
I ran into the 'unix_listener: "/home/my_name/.ansible/cp/ansible-ssh-vvvvvveerrrrryyyyy_looonnnngggggg_ssserrrveeerrr_nnnaaammmmeeeee.5GoIZEXF2gwQ7DF0" too long for Unix domain socket'  so I tried changing ControlPath to %(directory)s/ansible-ssh-%%r

Then all my remote commands started getting executed on localhost even though the logs indicated they were running on the target hosts.  So I'm guessing ControlPath is the problem. yes?

If so, is there a more appropriate solution to this problem?


Matt Martz

unread,
Aug 14, 2015, 6:38:51 PM8/14/15
to ansible...@googlegroups.com
The controlpath uses %r, %h and %p to differentiate socket files for different hosts.

In particular %h is for the host name.  I see you only have %r which is the remote username.  By removing %h you will most definitely run into a situation where you are running commands on the wrong host, since it is using a control socket for the first host that is connected to.

You can use other paths instead of %(directory) or remove ansible-ssh- from the path for making it shorter.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c0b9347a-f716-4f5d-b2b1-eb5de6fe9c5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

Reply all
Reply to author
Forward
0 new messages