IBM / ansible-for-i

the tool is to provide several customized modules for Ansible to manage IBM i systems.
GNU General Public License v3.0
56 stars 55 forks source link

ibmi.ibmi_copy module - sending savf to multiple endpoints #160

Open NickFrazee opened 1 year ago

NickFrazee commented 1 year ago

Having an issue when trying to distribute a savf to multiple endpoints simultaneously. It works fine if it's only one node, but once I add in more I get the following errors:

[WARNING]: sftp transfer mechanism failed on [Sys1]. Use ANSIBLE_DEBUG=1 to see detailed information [WARNING]: sftp transfer mechanism failed on [Sys2]. Use ANSIBLE_DEBUG=1 to see detailed information [WARNING]: scp transfer mechanism failed on [Sys1]. Use ANSIBLE_DEBUG=1 to see detailed information [WARNING]: piped transfer mechanism failed on [Sys1]. Use ANSIBLE_DEBUG=1 to see detailed information [WARNING]: scp transfer mechanism failed on [Sys2]. Use ANSIBLE_DEBUG=1 to see detailed information [WARNING]: piped transfer mechanism failed on [Sys2]. Use ANSIBLE_DEBUG=1 to see detailed information

When turning on the debug, here is the output:

ESTABLISH SSH CONNECTION FOR USER: user SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/home/user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="user"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o ControlPath=/home/user/.ansible/cp/fbbb283095 Sys1 '/bin/sh -c '"'"'rm -f -r /home/user/.ansible/tmp/ansible-tmp-1694438605.5207732-5475-25297357676014/ > /dev/null 2>&1 && sleep 0'"'"'' (0, b'', b'') fatal: [Sys1]: FAILED! => { "changed": false, "checksum": "", "delta": "", "dest": "", "job_log": [], "md5sum": "", "msg": "failed to transfer file to /qsys.lib/lib.lib/savefile.file /QSYS.LIB/lib.LIB/savefile.FILE:\n\ndd: write error: Bad file number\ndd: /QSYS.LIB/lib.LIB/savefile.FILE: Bad file number\ndd parent can't write pipe: Broken pipe\n", "rc": 255, "remote_checksum": "", "remote_md5sum": "", "src": "", "stderr": "", "stdout": "" }
NickFrazee commented 1 year ago

I can get around this by adding "serial: 1" in my playbook to execute on one node at a time, but makes for a long deployment.

robgjertsen1 commented 1 year ago

Can you provide the playbook (just the task that uses ibmi_copy module) or if using command line, then the full command? Also helpful to know what version of collection, and the Ansible and python version on control node.

NickFrazee commented 1 year ago

Here you go!

ansible 2.9.10 Python 3.9.16

module: ibmi_copy short_description: Copy a save file from local to a remote IBM i node version_added: '1.0.0'

here is the task in my playbook:

robgjertsen1 commented 1 year ago

Couple of questions. Are you running the playbook on an IBM i as control node (just trying to understand environment)? Interesting that it works fine with serializing the end points / targets. I was wondering if you see a similar error with only setting "force" as True, while turning off backup?