Ansible for IBM Z

Ansible for IBM Z

Ansible for IBM Z

Facilitate communication, user interaction and feedback for Red Hat Ansible Certified Content for IBM Z

 View Only
  • 1.  Execute playbook with ansible awx

    Posted Thu July 18, 2024 09:26 AM

    Hello everyone,

    does anyone have experience with executing a playbook with ansible awx/tower in an execution environment?

    I did build a default execution environment with the ibm.ibm_zos_core collection in it. As soon as it tries do execute a module from this collection, the playbook fails with:

    {
      "module_stdout": "/home/###/.ansible/tmp/ansible-tmp-1721300005.3040354-44-128306311444461/AnsiballZ_zos_ping.rexx 1: FSUM7332 syntax error: got (, expecting Newline\r\n",
      "module_stderr": "Shared connection to ### closed.\r\n",
      "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
      "rc": 1,
      "_ansible_no_log": false,
      "changed": false
    }

    When I run the exactly same playbook from my workstation without an execution environment, it works well. Does anyone has an idea to fix this issue?

    Kind regards,

    Michael



    ------------------------------
    Michael Witzgall
    ------------------------------


  •   2.  RE: Execute playbook with ansible awx
    Best Answer

    Posted Thu July 18, 2024 01:27 PM
    Edited by Demetri Dimatos Tue July 23, 2024 01:04 AM

    Hello Michael,

    I am using AAP 4.4.7 but not an execution environment at the moment but I think I may know what this is related to, please review the zos_ping modules notes section here

    In a nutshell, I think got (, expecting Newline\r\n", is a transmission error meaning this module whose source is REXX was transferred using SFTP hence as BINARY meaning  no auto conversion from UTF-8 to EBCDIC and therefore the z/OS REXX interpreter complained with the above. 

    In the module docs I had written (below) as well as some other advice.

    OpenSSH 9.0, it switches from SCP to use SFTP by default, meaning transfers are no longer treated as text and are transferred as binary preserving the source files encoding resulting in a module failure....

    To resolve this add scp_extra_args="-O" to your `ansible.cfg`, if in AAP (I am not using AWX, but you should be able to add it to your hosts inventory).

    Optionally a quick test might be to augment your job template (playbook) like in this discussion here and add  scp_extra_args="-O" to the vars: section. 



    ------------------------------
    Demetri Dimatos
    IBM zOS Ansible Core Senior Technical Lead
    IBM
    San Jose
    ------------------------------



  • 3.  RE: Execute playbook with ansible awx

    Posted Mon July 22, 2024 02:49 AM

    Hi Demetri,

    thanks, thats it! It works fine.

    Kind regards,

    Michael



    ------------------------------
    Michael Witzgall
    ------------------------------



  • 4.  RE: Execute playbook with ansible awx

    Posted Tue July 23, 2024 01:03 AM

    Hello Michael, glad to hear it worked out for you. Thanks for posting. 

    Demetri



    ------------------------------
    Demetri Dimatos
    IBM zOS Ansible Core Senior Technical Lead
    IBM
    San Jose
    ------------------------------