ansible-for-i icon indicating copy to clipboard operation
ansible-for-i copied to clipboard

ibmi.ibmi_copy module - sending savf to multiple endpoints

Open NickFrazee opened this issue 1 year ago • 4 comments

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:

<Sys1> ESTABLISH SSH CONNECTION FOR USER: user <Sys1> 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'"'"'' <Sys1> (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 avatar Sep 11 '23 14:09 NickFrazee

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.

NickFrazee avatar Sep 11 '23 15:09 NickFrazee

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.

robgjertsen1 avatar Sep 11 '23 22:09 robgjertsen1

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:

  • hosts: ibmi gather_facts: no collections:

    • ibm.power_ibmi serial: 1

    tasks:

    1

    • name: Distribute WEBSERVICE savf. ibm.power_ibmi.ibmi_copy: src: '/qsys.lib/mylib.lib/WEBSERVICE.file' lib_name: 'MYLIB' force: True backup: True

NickFrazee avatar Sep 12 '23 12:09 NickFrazee

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?

robgjertsen1 avatar Sep 18 '23 19:09 robgjertsen1