ansible
ansible copied to clipboard
Using illumos/solaris controller fails with termios.error: (22, 'Invalid argument')
Summary
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
Bug Report
Component Name
network_cli
Ansible Version
$ ansible --version
$ 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
Configuration
$ ansible-config dump --only-changed
$ ansible-config dump --only-changed | cat
DEFAULT_HOST_LIST(/export/home/olbohlen/git/ansible-playbooks/sin/ansible.cfg) = ['/export/home/olbohlen/git/ansible-playbooks/sin/inventory']
DEFAULT_REMOTE_USER(/export/home/olbohlen/git/ansible-playbooks/sin/ansible.cfg) = localadm
DEFAULT_TIMEOUT(/export/home/olbohlen/git/ansible-playbooks/sin/ansible.cfg) = 30
DEFAULT_TRANSPORT(/export/home/olbohlen/git/ansible-playbooks/sin/ansible.cfg) = ssh
OS / Environment
OpenIndiana Hipster 2021.10, SunOS x230 5.11 illumos-3e8b6b84e5 i86pc i386 i86pc
Steps to Reproduce
$ ansible -m ping bifroest.mgmt.home.eenfach.de
Expected Results
I expected to get the typical "ping": "pong" reply back
Actual Results
(1488) x230:/export/home/olbohlen/git/ansible-playbooks/sin$ ansible -m ping bifroest.mgmt.home.eenfach.de
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: termios.error: (22, 'Invalid argument')
bifroest.mgmt.home.eenfach.de | FAILED! => {
"msg": "Unexpected failure during module execution.",
"stdout": ""
}
Code of Conduct
- [X] I agree to follow the Ansible Code of Conduct
Files identified in the description:
-
lib/ansible/plugins/connection/network_cli.py
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.
- lib/ansible/plugins/connection/network_cli.py -> https://github.com/ansible-collections/ansible.netcommon (https://galaxy.ansible.com/ansible/netcommon)
For further information, please see: https://github.com/ansible/ansibullbot/blob/devel/docs/collection_migration.md
!component =task_executor.py
!needs_collections_redirect
!component =lib/ansible/executor/task_executor.py
Thanks for the help
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.