Closed olbohlen closed 2 years ago
You got redirected here by ansibot, but this really is an issue with ansible, and task_executor in particular. https://github.com/ansible/ansible/issues/76972 has been reopened, so I'm closing this issue because there really isn't anything netcommon can do.
SUMMARY
network_cli fails on illumos/SunOS/Solaris control nodes because termios tries to operate on the parent pty. When I try to run any ansible module from my illumos (SunOS) control node using the network_cli connection method, I get the following error:
The full traceback is: Traceback (most recent call last): File "/export/home/olbohlen/.local/lib/python3.9/site-packages/ansible/executor/task_executor.py", line 1155, in start_connection termios.tcsetattr(master, termios.TCSANOW, new) termios.error: (22, 'Invalid argument')
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/export/home/olbohlen/.local/lib/python3.9/site-packages/ansible/executor/task_executor.py", line 158, in run res = self._execute() File "/export/home/olbohlen/.local/lib/python3.9/site-packages/ansible/executor/task_executor.py", line 532, in _execute self._connection = self._get_connection(cvars, templar) File "/export/home/olbohlen/.local/lib/python3.9/site-packages/ansible/executor/task_executor.py", line 965, in _get_connection socket_path = start_connection(self._play_context, options, self._task._uuid) File "/export/home/olbohlen/.local/lib/python3.9/site-packages/ansible/executor/task_executor.py", line 1161, in start_connection termios.tcsetattr(master, termios.TCSANOW, old) termios.error: (22, 'Invalid argument') bifroest.mgmt.home.eenfach.de | FAILED! => { "msg": "Unexpected failure during module execution.", "stdout": "" }
(1481) x230:/export/home/olbohlen/git/ansible-playbooks/sin$ ansible --version ansible [core 2.12.2] config file = /export/home/olbohlen/git/ansible-playbooks/sin/ansible.cfg configured module search path = ['/export/home/olbohlen/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /export/home/olbohlen/.local/lib/python3.9/site-packages/ansible ansible collection location = /export/home/olbohlen/.ansible/collections:/usr/share/ansible/collections executable location = /export/home/olbohlen/.local/bin/ansible python version = 3.9.10 (main, Jan 17 2022, 16:23:45) [GCC 7.5.0] jinja version = 3.0.3 libyaml = True
The reason is described also in https://github.com/amoffat/sh/issues/143, you cannot call termios.tcsetattr() on the master side of the pty pair on Unix98 systems like illumos, Solaris, HP-UX, etc...
Unfortunately my python knowledge is way too bad to fix the issue by myself.
ISSUE TYPE
COMPONENT NAME
network_cli
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
OpenIndiana Hipster 2021.10, SunOS x230 5.11 illumos-3e8b6b84e5 i86pc i386 i86pc
STEPS TO REPRODUCE
It is enough to try to run the ping module, even this will fail.
EXPECTED RESULTS
I expected to get the typical "ping": "pong" reply back
ACTUAL RESULTS