Db2 for z/OS and its ecosystem community

 View Only

DBaaS - Db2 for z/OS services & Ansible playbooks

By M. Sueli Almeida posted Fri March 25, 2022 05:30 PM


By Sueli Almeida, Dipti Gandhi and Haley Fung



Many leading businesses that have begun their digital transformation journey rely on IBM Z and Db2 for z/OS to run their mission-critical applications and store one of their most valuable assets: their core business data.


Digital transformation demands that businesses can respond quickly and efficiently to changes in their industry. Responding to an ever-evolving business environment often results in application changes that must be implemented, tested, and deployed quickly with little to no downtime. 


The adoption of DevOps methodologies helps businesses achieve their digital transformation goals. One of the most important practices for accomplishing these goals is creating a CI/CD pipeline. A CI/CD pipeline is a collection of processes and automation tools that enable cross-functional teams to meet the growing demand for frequent releases and updates by consolidating build, test, and deployment capabilities into a single framework. Automation of database changes is a key element of these solution. 


IBM Db2 DevOps Experience (DOE) delivers Db2 for z/OS DBaaS as an integrated set of features. It is built on top of IBM Unified Management Server for z/OS (UMS), which is the platform for modern database management. IBM Unified Management Server with Db2 DevOps Experience enables a development team to implement DevOps practices by automating and standardizing tasks that would normally require interactions with an operations team. It helps bridge the gap between application developers and database administrators.


This solution provides collaboration between roles in an organization in the following practices:

  • Developers can easily provision a version of an application, make changes, test, and promote those changes for approval.
  • Quality Engineers can easily automate the creation of Db2 test environments optimize testing activities.
  • Administrators can set the site rules for Db2 schema standards and usage rules, review, and approve changes.


These practices decrease development time, improve quality, and better integrate into multi-platform development practices.


  • The figure below illustrates a high level architecture overview of UMS/DOE and Ansible playbooks calling DOE APIs for database operations. 

Ansible Automation Platform is a market-leading enterprise automation framework that provides a consistent automation solution across multiple platforms including IBM Z.  Backed by a vibrant Open Source community and with the new Red Hat Ansible Certified Content for IBM Z offering, you can jump start and modernize your IBM Z automation tasks using modern languages like Python instead of REXX or JCLs.  The Red Hat Ansible Certified Content for IBM Z offering provides ready-to-use sample Ansible playbooks to help you replace or coordinate existing manual or isolated in-house automation tools; deploy CICS, IMS, or Db2 application assets in a DevOps CI/CD pipeline; manage your network or security configuration; or simply just automate gathering information on your IBM Z systems for status reporting or audit purposes. 


By combing Ansible and Db2 DevOps Experience (DOE), you can have a powerful yet simple to use automation solution specific to your Db2 DevOps and automation needs.  The published Ansible playbooks implement sample flows to provision a Db2 schema instance of an application, deprovision a Db2 schema instance of an application, discover all registered "applications" that can be instantiated, and discover the information on all registered Db2 systems.


Ansible and Db2 DevOps Experience (DOE)

Ansible Db2 sample playbooks are available in the Ansible IBM Z Playbook Repository and leverage the IBM Db2 DevOps Experience (DOE) APIs services. Capabilities to discover Db2 system and application information as well as to automate Db2 application schema provisioning.  


The IBM Db2 DevOps Experience (DOE) delivers Db2 for z/OS APIs services and capabilities that can be used through a browser-based interface called the IBM Unified Experience for z/OS or by calling the REST APIs.  The rich set of REST APIs can be exploited in scripts like Ansible playbooks to automate database operations such as Db2 for z/OS schema changes, apply site rules, and more.


You can use these Ansible Playbooks integrated with Db2 DevOps Experience APIs to implement Db2 database as a service (DBaaS) and automate database operations.  These playbooks can be run standalone or via Kubernetes in order to discover registered applications that can be instantiated, discover Db2 subsystems and provision or deprovision new instances of an application by using IBM Db2 DevOps Experience for z/OS (DOE) APIs.



Getting Started with Ansible Db2 Sample Playbooks 

To implement the Ansible Db2 Sample playbooks, use the following steps:


  1. Make sure you have the following products installed:


    • IBM Unified Management Server for V1.1.0.4 or later
    • IBM Db2 DevOps Experience for z/OS V1.2.0.1 or later
    • Ansible 2.9 or later


  2. Though it is not required, consider getting the Red Hat Ansible Certified Content for IBM Z which provides Ansible collections that can automate z/OS and other middleware products.


    Red Hat Ansible Certified Content for IBM Z is available either from Ansible Automation Hub or the free community-based Ansible Galaxy site. 


  3. Access the Ansible Db2 samples in the Ansible for IBM Z playbook repository.  


  4. Implement one or more samples for your given scenario: