IBM Z and LinuxONE IBM Z

  • 1.  Ansible on z/OS - First Steps (and problems)

    Posted Mon January 24, 2022 03:43 AM
    Hello, everyone,

    I'm starting to play with Ansible on z/OS. I've made a very, very simple playbook (it just sets up a SSH tunnel to the mainframe and tries to download a dataset), and it fails with an illegible error message:

    fatal: [tunnel]: FAILED! => {"changed": false, "msg": "Error while gathering data set information", "rc": null, "stderr": "Failure during execution of mvscmd; Return code: 12; stdout: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@z@zz@@@@@@@@aa@@@@@@@@@@@\u0015@@@@@@@@\u0015@KKLKKKKKKKKNKKKKKKKKKKKKKKMPLKKKKKKKKKLLK\u0015@@@}KLKKKKKKKKNKKKKKKKKK}@\u0015@@@@@@K@@@@\u0015@@@@@@@@\u0015@@@K@@@@@\u0015; stderr: ", "stderr_lines": ["Failure during execution of mvscmd; Return code: 12; stdout: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@z@zz@@@@@@@@aa@@@@@@@@@@@\u0015@@@@@@@@\u0015@KKLKKKKKKKKNKKKKKKKKKKKKKKMPLKKKKKKKKKLLK\u0015@@@}KLKKKKKKKKNKKKKKKKKK}@\u0015@@@@@@K@@@@\u0015@@@@@@@@\u0015@@@K@@@@@\u0015; stderr: "], "stdout": null, "stdout_lines": null}

    My guess is there is a codepage transformation going mad here, but I've tried to translate manually the garbage I get and have not been able to obtain a legible text. Incidentallty, this happens after the dataset has been downloaded. 

    As reference, the task where this happens is this:

      - name: Download mainframe text file

          zos_fetch:
            src: T8864.U0G.SIMPLRC.B64
            dest: ./simplrc.b64
          encoding:
              from: IBM-1145
              to: UTF-8

    But I'm more interested about the garbled message thing that the specific error in itself (that I will try to fix once I know what it is!)

    Thanks in advance!





    ------------------------------
    Jordi Guillaumes Pons
    ------------------------------


  • 2.  RE: Ansible on z/OS - First Steps (and problems)

    Posted Mon January 24, 2022 04:13 PM

    No real idea or knowledge, but FWIW the EBCDIC blank is x'40', and x'40' is '@' in ASCII, so one often sees rows of @@@@@ in EBCDIC text which has been rendered as though ASCII. In other words, if something "thinks" it is ASCII when it is really EBCDIC.

     

    Charles

     






  • 3.  RE: Ansible on z/OS - First Steps (and problems)

    Posted Tue January 25, 2022 04:00 AM
    Yes, I think Charles is right and there are issues with EBCDIC to ASCII conversion.
    Have a deeper look at the zos_fetch module description
    https://ibm.github.io/z_ansible_collections_doc/ibm_zos_core/docs/source/modules/zos_fetch.html
    There is a is_binary flag that you might have to use to fetch binary files.
    It seems the encoding translations you specified is just required/used when fetching non binary files.

    ------------------------------
    Thomas Luther
    ------------------------------



  • 4.  RE: Ansible on z/OS - First Steps (and problems)

    Posted Tue January 25, 2022 04:52 AM
    Hello, and thanks for the replies.

    Yes, indeed there is a codepage translation problem. The issue is I'm using the z/os core ansible module to interact with the mainframe, and although there are provisions to specify the source and destination codepages for a fetch operation (the one I'm trying), there is no way (that I can find) to control the translation of the messages generated by the Ansible module itself (in this case, it is executing the ZOAU mvscmd program, which outputs an error to stderr or stdout, and is THIS error message what is garbled/mistranslated when it is sent to the Ansible controller.

    I've searched how to control this translation, but I've found nothing. 

    So I'm stuck...

    ------------------------------
    Jordi Guillaumes Pons
    ------------------------------



  • 5.  RE: Ansible on z/OS - First Steps (and problems)

    Posted Mon January 31, 2022 01:48 AM

    Hello Jordi,
    It is interesting that you are seeing the output come back unreadable. Ansible when connecting with the managed node will not inherit any `.profile` that may exist on the managed node, instead it will rely on spawning a new shell using the environment variables configured in this group variables section. If you could provide the output of your minimized playbook using this format  below, I could see how Ansible is configured. 

    ANSIBLE_DEBUG=1 ansible-playbook -i inventory your-playbook.yml -vvvv


    This particular module is comprised of both an action plugin and a module, where and action plugin executes on the controller and module on the managed node, it is possible we are seeing both reporting back messages hence the partially unreadable error. 



    ------------------------------
    DEMETRIOS DIMATOS
    ------------------------------



  • 6.  RE: Ansible on z/OS - First Steps (and problems)

    Posted Mon January 31, 2022 09:41 AM
    Edited by Jordi Guillaumes Pons Mon January 31, 2022 09:55 AM
    Hello Demetrios,

    Got it. My problem was I wasn't properly defining the remote environment variables. Once I fixed that, I have been able to correctly read the error message:

    fatal: [sysw]: FAILED! => {"changed": false, "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 137,
    "stderr": "Shared connection to localhost closed.\r\n", "stderr_lines": null, "stdout": "CEE3501S The module
    libpython3.8.so was not found.\r\n From compile unit TOROLABA:./Python/dynload_shlib.c at entry point
    _PyImport_FindSharedFuncptr at statement 100 at compile unit offset +000000003E6A0040 at entry offset
    +0000000000000290 at address 000000003E6A0040.\r\n", "stdout_lines": null}

    We have got python 3.9, and something is expecting 3.8... :(

    EDIT: The culprit is the native ZOAU library:

    T88640G:/global/IBM/ZOAU111/lib/zoautil_py> strings core.so | grep pyth
    libpython3.8.so
    libpython3.8.soH

    We have installed ZOAU 1.1.1. I guess we'll have to install 1.2, although I've been unable to obtain the prerreq report (the IBM page, 5698-PA1 IBM Z Open Automation Utilities 1.2, keeps showing information for 1.0.1...)






    ------------------------------
    Jordi Guillaumes Pons
    ------------------------------



  • 7.  RE: Ansible on z/OS - First Steps (and problems)

    Posted Mon January 31, 2022 02:01 PM
    Hello Jordi, glad it was only environment variables for the mixed messages.

    As for the Python 3.8 comment, in ZOAU 1.1.1 there is a step you can take documented here under heading "Configuring ZOA Utilities" > "PYTHONPATH environment method" where when using Python 3.9, running `configure.py` will create the necessary object (symbolic link) ZOAU is looking for. 
    ${ZOAU_HOME}/lib/zoautil_py/config/./configure.py​

    As for the documentation @Nate Myers can help ensure/correct "IBM Z Open Automation Utilities 1.2.0 (5698-PA1)" under this section.

    ​​

    ------------------------------
    DEMETRIOS DIMATOS
    ------------------------------



  • 8.  RE: Ansible on z/OS - First Steps (and problems)

    Posted Tue February 01, 2022 03:06 AM
    Hi Demetrios,

    Nice! I've passed this info to the sysprog team... it looks they omitted some steps from the install guide! 

    Thanks a lot!


    ------------------------------
    Jordi Guillaumes Pons
    ------------------------------