MQ

MQ

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  IBM MQ Objects as Code - exploring an Ansible-based approach

    Posted 8 days ago

    IBM MQ Objects as Code - exploring an Ansible-based approach

    I've been working with IBM MQ for many years, and I've recently been experimenting with a different way of managing MQ configuration.

    The idea is to treat IBM MQ objects as code.

    Instead of relying primarily on manually maintained MQSC commands, the desired MQ configuration can be represented as YAML and managed through Ansible.

    For example:

    queues:
      - name: APP.REQUEST
        type: local
        host_qmgr: QM1
        max_depth: 5000
    

    The basic workflow is:

    YAML → Validation → Ansible → IBM MQ

    The goal is to make MQ configuration:

    • Version controlled

    • Reviewable

    • Repeatable

    • Consistent across environments

    • Easier to automate

    I'm deliberately trying to keep the model simple enough that an MQ administrator can look at the YAML and immediately understand what MQ objects are intended to exist.

    The project currently focuses on MQ object automation and is evolving toward broader object coverage and stronger validation.

    I've made the project open source on GitHub:

    GitHub - ankur-lodhi/mq_objects_as_code: Manage IBM MQ objects as code using YAML and Ansible. Validate, version-control, and automate MQ configuration across environments.

    GitHub remove preview
    GitHub - ankur-lodhi/mq_objects_as_code: Manage IBM MQ objects as code using YAML and Ansible. Validate, version-control, and automate MQ configuration across environments.
    Manage IBM MQ objects as code using YAML and Ansible. Validate, version-control, and automate MQ configuration across environments. - ankur-lodhi/mq_objects_as_code
    View this on GitHub >

    I'd really value feedback from experienced IBM MQ administrators and integration engineers.

    In particular:

    1. Does this approach make sense for managing MQ configuration?

    2. Which MQ objects would you consider essential for an "Objects as Code" model?

    3. What would you expect from validation and idempotency before using something like this in a production environment?

    I'm particularly interested in learning from people who have managed large MQ environments and have dealt with configuration consistency across DEV, TEST and PROD.

    Thanks in advance for any feedback or suggestions.



    ------------------------------
    Ankur Lodhi
    IBM MQ | Middleware | Ansible | Automation | Infrastructure as Code
    ------------------------------


  • 2.  RE: IBM MQ Objects as Code - exploring an Ansible-based approach

    Posted 4 days ago

    Hi Ankur,

    Thank you for sharing your project and code! It is great to see the community actively driving the modernization of IBM MQ administration towards GitOps and Infrastructure as Code (IaC).

    In our enterprise environment, we are pursuing a very similar strategic approach. As an enterprise user focusing on long-term maintainability and standardization, we closely follow the development of the official IBM Ansible Collections and align our IaC roadmap with vendor-supported solutions.

    To address your specific questions and share some thoughts on your technical approach:

    1. Viability & Essential Objects (Questions 1 & 2):
    Representing MQ configurations declaratively in YAML is definitely the right way forward. For a true "Objects as Code" model in an enterprise environment, covering the full spectrum of object types is essential. Beyond local queues, this must include remote/alias queues, all channel types (SDR, RCVR, SVRCONN, etc.), topic definitions, process definitions, and authentication information objects, etc.

    2. Validation and Idempotency (Question 3):
    Strict idempotency is non-negotiable for production environments. One of the main challenges with MQ is platform diversity. A robust IaC approach must validate and execute consistently across various OS platforms (Linux/AIX, Windows, but also z/OS and MQ Appliances). This is also where we, as enterprise customers, look forward to robust, vendor-backed validation mechanisms within the official collections in the future.

    3. Technical Food for Thought:
    Your current workflow relies on generating and executing MQSC commands (e.g., via `runmqsc` or `CSQUTIL` on z/OS). While this is proven and highly efficient, you might want to consider two alternative interfaces to further enhance platform-agnostic automation:

    • PCF (Programmable Command Formats): Using an MQ client with PCF allows for highly precise, programmatic object management directly over the network.
    • REST API (MQ Web Administration): Leveraging the administrative REST API is ideal for modern CI/CD pipelines. It integrates beautifully with Ansible (e.g., via the `uri` module) without requiring local MQ administration tools on the executing node.

    Thank you again for this valuable initiative. I am excited to see how your project and the official vendor collections will continue to evolve and inspire each other!

    Best regards,
    Martin



    ------------------------------
    Martin Hörandel
    ------------------------------



  • 3.  RE: IBM MQ Objects as Code - exploring an Ansible-based approach

    Posted 4 days ago

    Thank you for taking the time to write your valuable feedback.

    Initially, I started this project simply to brush up on my Ansible skills, but it got interesting along the way and I decided to keep developing it further. My main goal has been to keep the approach simple and practical.

    That's also why I decided to use MQSC commands. If an MQ administrator comes across the project, they shouldn't need to be an Ansible expert to understand what is happening. The MQSC commands should make the intent and the actual MQ configuration easy to follow.

    I'll definitely try to keep this approach as I continue developing the project and make it more scalable and obeservabiltiy and finally move towards Event based automation. 



    ------------------------------
    Ankur Lodhi
    ------------------------------



  • 4.  RE: IBM MQ Objects as Code - exploring an Ansible-based approach

    Posted 3 days ago

    Hi Ankur,

    your forum post got me thinking and finally prompted me to dust off and finalize an idea/request for IBM that I prepared many months ago. I submitted the 'Idea' for an IBM MQ Ansible Collection today and would be very happy to have your support, as well as the support of anyone else who might be interested.

    Best regards,
    Martin



    ------------------------------
    Martin Hörandel
    ------------------------------



  • 5.  RE: IBM MQ Objects as Code - exploring an Ansible-based approach

    Posted 2 days ago

    This is a very interesting proposal, it closely aligns with the area I have been exploring through my project MQ Objects as Code.

    My project started from the operational side of the same problem: how can we manage IBM MQ configuration as a declarative model rather than relying primarily on manually maintained MQSC commands and host-level administration?

    My current approach is:

    YAML → MQ Objects as Code → Validation → Git → Ansible → IBM MQ

    The idea of having an officially supported IBM Ansible Collection takes this concept further, particularly around true desired-state management, check/diff capabilities, security objects such as CHLAUTH and OAM, and centralized administration.

    I also found the discovery capability in IBM's Middleware Configuration Tool in Z/OS particularly interesting because it addresses the problem from the opposite direction - taking an existing MQ environment and bringing it into a declarative configuration model.

    Combining these two directions could provide an interesting lifecycle:

    Existing MQ → Discover → YAML → Validate → Git → Ansible → MQ

    I think there is a lot of value in exploring this model further, especially for enterprises trying to move toward GitOps, Zero-Touch administration and stronger configuration governance.

    I've released the initial version of MQ Objects as Code as an open-source project and will continue exploring this area.



    ------------------------------
    Ankur Lodhi
    ------------------------------



  • 6.  RE: IBM MQ Objects as Code - exploring an Ansible-based approach

    Posted 19 hours ago

    Hi Martin

    Great idea! We use Ansible playbooks to create and manage MQ environments as well, including Dev, SIT, UAT, Production, and DR.

    we have to rely on a mix of Ansible playbooks and Bash scripts, which works, but troubleshooting and debugging can be painful.

    An IBM MQ Ansible Collection would make automation much cleaner and easier to maintain.

    I've already voted for the idea and would encourage others who are interested to support it too! 👍



    ------------------------------
    Cheng zhou Tan
    ------------------------------



  • 7.  RE: IBM MQ Objects as Code - exploring an Ansible-based approach

    Posted 2 days ago

    There is a collection in GitHub.

    https://github.com/ibm-messaging/mq-ansible



    ------------------------------
    Robert (Bobbee) Broderick
    Senior WebSphere Consultant
    IBM
    Madison
    917-453-6790
    ------------------------------