MQ

 View Only
  • 1.  procedure to create local queue on ibm linux server

    Posted Thu September 28, 2023 12:47 PM

    Hi

    I want to create a local queue using playbook on ibm linux server, how to do that ? 

    Wants code for playbook to create qlocal and any prerequisite to accomplish before it .

    Thanks 



    ------------------------------
    Amir Ali
    ------------------------------


  • 2.  RE: procedure to create local queue on ibm linux server

    Posted Fri September 29, 2023 02:39 AM
    Edited by Mayur RAJA Fri September 29, 2023 03:01 AM

    Hi Amir, 

    So long as you have Ansible on your local machine, you should be able to run playbooks to create MQ resources on your Queue Manager on Linux. This may help you: https://community.ibm.com/community/user/integration/blogs/mayur-raja1/2023/05/22/mq-ansible-yaml-commands-collection , but because it uses the MQ REST API, it relies on you configuring an MQ Web Server. 

    You may also want to check out this work https://github.com/ibm-messaging/mq-ansible

    Regards .. Mayur



    ------------------------------
    Mayur RAJA
    ------------------------------



  • 3.  RE: procedure to create local queue on ibm linux server

    Posted Sat September 30, 2023 08:13 AM
    Edited by Mayur RAJA Sat September 30, 2023 10:21 AM

    Hi Amir, 

    In an Ansible playbook, you can also make use of the Ansible supplied shell module to issue MQSC commands as follows:

        - name: Execute a MQ Command
          shell:
            cmd:  "echo 'DISPLAY QMGR ALL' | ./runmqsc MyMQLinuxQMgr"
            chdir: /opt/mqm/bin
          register: qmgralloutput
    
        - debug:
            var: qmgralloutput.stdout_lines

    So, you could echo a DEFINE QLOCAL command, or any other MQSC command and pipe it into the runmqsc command targeted for your MQ for Linux QMgr. As long as the hosts: variable in your Ansible playbook points to the hostname of your MQ for Linux QMgr, it will work.

    ------------------------------
    Mayur RAJA
    ------------------------------