Closed tlc closed 5 years ago
Is this error reproducible?
Yep.
A comment says
# If we are using SSH password authentication, write the password into
# the pipe we opened in _build_command.
But I don't see a pipe opened in _build_command. Also, I only see sshpass_pipe used in the PY3 case.
Looks like no one used that code path before (and I just basically took that over from othe previous author).
_build_command() is never opening a pipe using sshpass_pipe, but I don't know why the code is even trying to recreate them in line 585.
@tlc Can you write a patch which will fix this problem?
@andreasscherbaum Are you saying that use of passwords (-k) have never been tested? But ssh keys work?
@tlc At least not by me. If you look at the fork history, this repo was forked from "chifflier" who wrote the initial version. I only made additional changes and updates, with help from others.
@tlc Do you plan to look into this issue, otherwise I plan to close it.
You're going to close an issue because the reporter won't fix it?
I briefly looked into the code, but could not identify the problem. Also I don't find the use case "enter a password every time" compelling enough for a system which relies on automation all the way.
I can keep the issue open if you like, but I don't plan to spend more time on it. That's why I asked if you plan to dig deeper. If you can provide a PR which will fix the problem, I'm happy to merge it.
I've hit the same today. But I'm python3.
The full traceback is:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/ansible/executor/task_executor.py", line 146, in run
res = self._execute()
File "/usr/local/lib/python3.7/dist-packages/ansible/executor/task_executor.py", line 601, in _execute
self._connection = self._get_connection(variables=variables, templar=templar)
File "/usr/local/lib/python3.7/dist-packages/ansible/executor/task_executor.py", line 892, in _get_connection
ansible_playbook_pid=to_text(os.getppid())
File "/usr/local/lib/python3.7/dist-packages/ansible/plugins/loader.py", line 573, in get
obj = obj(*args, **kwargs)
File "/root/ansible/connection_plugins/lxc_ssh.py", line 137, in __init__
(returncode2, stdout2, stderr2) = self._exec_command("which lxc", None, False)
File "/root/ansible/connection_plugins/lxc_ssh.py", line 685, in _exec_command
(returncode, stdout, stderr) = self._run(cmd, in_data, sudoable=sudoable)
File "/root/ansible/connection_plugins/lxc_ssh.py", line 84, in wrapped
return_tuple = func(self, *args, **kwargs)
File "/root/ansible/connection_plugins/lxc_ssh.py", line 664, in _run
return self._bare_run(cmd, in_data, sudoable, checkrc)
File "/root/ansible/connection_plugins/lxc_ssh.py", line 409, in _bare_run
p = subprocess.Popen(cmd, stdin=slave, stdout=subprocess.PIPE, stderr=subprocess.PIPE, pass_fds=self.sshpass_pipe)
AttributeError: 'Connection' object has no attribute 'sshpass_pipe'
101 | FAILED! => {
"msg": "Unexpected failure during module execution.",
"stdout": ""
}
Again, if someone can provide a working PR for the issue where you enter a password all the time, I'm happy to merge it.
Having this issue using
$ ansible-playbook --version ansible-playbook 2.7.8
I am using -k and a password.