I have a long path name to my home directory and some fairly long hostnames so I’m hitting the 108 character limit on the control_path
As a test I changed control_path in the ansible.cfg
control_path = /var/tmp/.ansible/cp/%%h-%%p-%%r
Things did not work until I manually created the .ansible/cp inside the /var/tmp/ directory.
Any reason Ansible doesn’t securely create the control_path?
My old control_path
control_path = %(directory)s/%%h-%%p-%%r
I do not recall making the (effectively) $HOME/.ansible/cp/ directory so what changes when moving it to /var/tmp?
Running ansible with “-vvvv” and taking that command and executing it by hand.
$ ssh -C -vvv -o ControlMaster=auto -o ControlPersist=600s -o ForwardAgent=yes -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/var/tmp/.ansible/cp/%h-%p-%r verylonghostname.longsubdomain.real-time.com LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python
debug3: muxserver_listen: temporary control path /var/tmp/.ansible/cp/verylonghostname.longsubdomain.real-time.com-22-ansible.e36VI5Uh9JoNL2x2
bind: No such file or directory
unix_listener: cannot bind to path: /var/tmp/.ansible/cp/verylonghostname.longsubdomain.real-time.com-22-ansible.e36VI5Uh9JoNL2x2
$ mkdir /var/tmp/.ansible
$ ssh -C -vvv -o ControlMaster=auto -o ControlPersist=600s -o ForwardAgent=yes -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/var/tmp/.ansible/cp/%h-%p-%r verylonghostname.longsubdomain.real-time.com LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python
debug3: muxserver_listen: temporary control path /var/tmp/.ansible/cp/verylonghostname.longsubdomain.real-time.com-22-ansible.e36VI5Uh9JoNL2x2
bind: No such file or directory
unix_listener: cannot bind to path: /var/tmp/.ansible/cp/verylonghostname.longsubdomain.real-time.com-22-ansible.e36VI5Uh9JoNL2x2
$ mkdir /var/tmp/.ansible/cp
$ ssh -C -vvv -o ControlMaster=auto -o ControlPersist=600s -o ForwardAgent=yes -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/var/tmp/.ansible/cp/%h-%p-%r verylonghostname.longsubdomain.real-time.com LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python
Now things work.