-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ibm.power_aix.filesystem cannot be executed more than one time #582
Comments
@schamola , Please make sure that this is fixed and get shipped with our next release. |
Hi @AIXruth |
@AIXruth |
Thank you for the correction. I can confirm from my side that multiple execution is now possible. However, I have noticed two other small errors:
Both these errors are not relevant in MY case, but I wanted to mention them. |
Thanks for confirming that It's working fine for you! For some attributes, there is inconsistency in naming when using crfs and chfs commands... the issues that you have mentioned could be because of that. |
Closing this issue, we can have separate issue opened in case we need to change anything in the collection for 2 other errors mentioned. |
I configured a NFS mount point via modul ibm.power_aix.filesystem. It works fine for the first time, but if I execute it a second time it will fail. The error occurs in the function compare_attrs(), because an expected array item does not exist (lines2[2])
To Reproduce
Use a similar task as and execute it more than one time. Afterwards you will get the error and traceback as below:
TASK [/home/myuser/ansible/roles/mksysb : Ensure NFS mount is defined in /etc/filesystems with dynamic NFS server] *****************
task path: /home/myuser/ansible/roles/mksysb/tasks/main.yml:52
ESTABLISH SSH CONNECTION FOR USER: None
SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 'ControlPath="/home/myuser/.ansible/cp/d90c328ef5"' myserver '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
(0, b'/home/myuser\n', b'')
ESTABLISH SSH CONNECTION FOR USER: None
SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 'ControlPath="/home/myuser/.ansible/cp/d90c328ef5"' myserver '/bin/sh -c '"'"'( umask 77 && mkdir -p "
echo /home/myuser/.ansible/tmp
"&& mkdir "echo /home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634
" && echo ansible-tmp-1733907430.024256-32309600-11489077981634="echo /home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634
" ) && sleep 0'"'"''(0, b'ansible-tmp-1733907430.024256-32309600-11489077981634=/home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634\n', b'')
Using module file /home/myuser/.ansible/collections/ansible_collections/ibm/power_aix/plugins/modules/filesystem.py
PUT /home/myuser/.ansible/tmp/ansible-local-33030636vk8voswm/tmp04tca12l TO /home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/AnsiballZ_filesystem.py
SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 'ControlPath="/home/myuser/.ansible/cp/d90c328ef5"' '[myserver]'
(0, b'sftp> put /home/myuser/.ansible/tmp/ansible-local-33030636vk8voswm/tmp04tca12l /home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/AnsiballZ_filesystem.py\n', b'')
ESTABLISH SSH CONNECTION FOR USER: None
SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 'ControlPath="/home/myuser/.ansible/cp/d90c328ef5"' myserver '/bin/sh -c '"'"'chmod u+x /home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/ /home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/AnsiballZ_filesystem.py && sleep 0'"'"''
(0, b'', b'')
ESTABLISH SSH CONNECTION FOR USER: None
SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 'ControlPath="/home/myuser/.ansible/cp/d90c328ef5"' -tt myserver '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-jhzqsvbnvfksjwafkhtglxsshasucpmw ; /opt/freeware/bin/python3.9 /home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/AnsiballZ_filesystem.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
Escalation succeeded
(1, b'Traceback (most recent call last):\r\n File "/home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/AnsiballZ_filesystem.py", line 107, in \r\n _ansiballz_main()\r\n File "/home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/AnsiballZ_filesystem.py", line 99, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File "/home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/AnsiballZ_filesystem.py", line 47, in invoke_module\r\n runpy.run_module(mod_name='ansible_collections.ibm.power_aix.plugins.modules.filesystem', init_globals=dict(_module_fqn='ansible_collections.ibm.power_aix.plugins.modules.filesystem', _modlib_path=modlib_path),\r\n File "/opt/freeware/lib64/python3.9/runpy.py", line 225, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File "/opt/freeware/lib64/python3.9/runpy.py", line 97, in _run_module_code\r\n _run_code(code, mod_globals, init_globals,\r\n File "/opt/freeware/lib64/python3.9/runpy.py", line 87, in _run_code\r\n exec(code, run_globals)\r\n File "/tmp/ansible_ibm.power_aix.filesystem_payload_bsmiz3eh/ansible_ibm.power_aix.filesystem_payload.zip/ansible_collections/ibm/power_aix/plugins/modules/filesystem.py", line 625, in \r\n File "/tmp/ansible_ibm.power_aix.filesystem_payload_bsmiz3eh/ansible_ibm.power_aix.filesystem_payload.zip/ansible_collections/ibm/power_aix/plugins/modules/filesystem.py", line 610, in main\r\n File "/tmp/ansible_ibm.power_aix.filesystem_payload_bsmiz3eh/ansible_ibm.power_aix.filesystem_payload.zip/ansible_collections/ibm/power_aix/plugins/modules/filesystem.py", line 435, in chfs\r\n File "/tmp/ansible_ibm.power_aix.filesystem_payload_bsmiz3eh/ansible_ibm.power_aix.filesystem_payload.zip/ansible_collections/ibm/power_aix/plugins/modules/filesystem.py", line 290, in compare_attrs\r\nIndexError: list index out of range\r\n', b'Shared connection to myserver closed.\r\n')
Failed to connect to the host via ssh: Shared connection to myserver closed.
ESTABLISH SSH CONNECTION FOR USER: None
SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 'ControlPath="/home/myuser/.ansible/cp/d90c328ef5"' myserver '/bin/sh -c '"'"'rm -f -r /home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/ > /dev/null 2>&1 && sleep 0'"'"''
(0, b'', b'')
The full traceback is:
Traceback (most recent call last):
File "/home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/AnsiballZ_filesystem.py", line 107, in
_ansiballz_main()
File "/home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/AnsiballZ_filesystem.py", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/AnsiballZ_filesystem.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible_collections.ibm.power_aix.plugins.modules.filesystem', init_globals=dict(_module_fqn='ansible_collections.ibm.power_aix.plugins.modules.filesystem', _modlib_path=modlib_path),
File "/opt/freeware/lib64/python3.9/runpy.py", line 225, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/opt/freeware/lib64/python3.9/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/opt/freeware/lib64/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/tmp/ansible_ibm.power_aix.filesystem_payload_bsmiz3eh/ansible_ibm.power_aix.filesystem_payload.zip/ansible_collections/ibm/power_aix/plugins/modules/filesystem.py", line 625, in
File "/tmp/ansible_ibm.power_aix.filesystem_payload_bsmiz3eh/ansible_ibm.power_aix.filesystem_payload.zip/ansible_collections/ibm/power_aix/plugins/modules/filesystem.py", line 610, in main
File "/tmp/ansible_ibm.power_aix.filesystem_payload_bsmiz3eh/ansible_ibm.power_aix.filesystem_payload.zip/ansible_collections/ibm/power_aix/plugins/modules/filesystem.py", line 435, in chfs
File "/tmp/ansible_ibm.power_aix.filesystem_payload_bsmiz3eh/ansible_ibm.power_aix.filesystem_payload.zip/ansible_collections/ibm/power_aix/plugins/modules/filesystem.py", line 290, in compare_attrs
IndexError: list index out of range
fatal: [myserver]: FAILED! => {
"changed": false,
"module_stderr": "Shared connection to myserver closed.\r\n",
"module_stdout": "Traceback (most recent call last):\r\n File "/home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/AnsiballZ_filesystem.py", line 107, in \r\n _ansiballz_main()\r\n File "/home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/AnsiballZ_filesystem.py", line 99, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File "/home/myuser/.ansible/tmp/ansible-tmp-1733907430.024256-32309600-11489077981634/AnsiballZ_filesystem.py", line 47, in invoke_module\r\n runpy.run_module(mod_name='ansible_collections.ibm.power_aix.plugins.modules.filesystem', init_globals=dict(_module_fqn='ansible_collections.ibm.power_aix.plugins.modules.filesystem', _modlib_path=modlib_path),\r\n File "/opt/freeware/lib64/python3.9/runpy.py", line 225, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File "/opt/freeware/lib64/python3.9/runpy.py", line 97, in _run_module_code\r\n _run_code(code, mod_globals, init_globals,\r\n File "/opt/freeware/lib64/python3.9/runpy.py", line 87, in _run_code\r\n exec(code, run_globals)\r\n File "/tmp/ansible_ibm.power_aix.filesystem_payload_bsmiz3eh/ansible_ibm.power_aix.filesystem_payload.zip/ansible_collections/ibm/power_aix/plugins/modules/filesystem.py", line 625, in \r\n File "/tmp/ansible_ibm.power_aix.filesystem_payload_bsmiz3eh/ansible_ibm.power_aix.filesystem_payload.zip/ansible_collections/ibm/power_aix/plugins/modules/filesystem.py", line 610, in main\r\n File "/tmp/ansible_ibm.power_aix.filesystem_payload_bsmiz3eh/ansible_ibm.power_aix.filesystem_payload.zip/ansible_collections/ibm/power_aix/plugins/modules/filesystem.py", line 435, in chfs\r\n File "/tmp/ansible_ibm.power_aix.filesystem_payload_bsmiz3eh/ansible_ibm.power_aix.filesystem_payload.zip/ansible_collections/ibm/power_aix/plugins/modules/filesystem.py", line 290, in compare_attrs\r\nIndexError: list index out of range\r\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: