Ansible for IBM Z Standardize and scale IBM Z automation with Ansible Get started

Ansible for IBM Z enables organizations to automate the configuration, deployment, and operation of IBM Z environments using the Red Hat® Ansible Automation Platform. It brings z/OS®, IBM Z middleware, and IBM Z infrastructure into the same automation framework used across the enterprise.

Through a portfolio of Red Hat Ansible Certified and Validated Content, Ansible for IBM Z supports automation for key platforms such as z/OS, IMS, CICS, z/OSMF, System Automation, and IBM Z HMC. Combined with Event-Driven Ansible, it enables both task based and real time automation, allowing IBM Z systems to participate fully in end to end, hybrid enterprise workflows with the reliability and governance required for mission critical workloads.

All the collections we offer today can be used with all the other collections contributed in the Ansible community (Jenkins, ServiceNow, DS8000, AWS, etc.) for any automation use-case you are interested in. For more details, see The Ansible for IBM Z portfolio.

Find more information about Red Hat Ansible Certified Content for IBM Z Join our Ansible for IBM Z Community
Big picture 1. Make sure you have the right software for your z/OS system. 2. Install Red Hat Ansible Certified Content for IBM Z Collections. 3. Start your automation journey by writing and executing Ansible playbooks. How to get started

Setting up z/OS to be an Ansible-managed node is simple. Ansible is an agentless architecture, which means that there’s no server-side component that needs to be installed on any managed node.

All you'll need is SSH enabled, z/OS Unix System Services enabled, Python, and IBM Z Open Automation Utilities.

After you’ve done that, any machine you are using as your Ansible control node will be able to connect to z/OS and drive the automation of your choosing.

IBM Z Open Automation Utilities (ZOA Utilities) helps z/OS developers automate tasks that access MVS™ resources. It enables easier calling of MVS utilities compared with JCL by providing a natural coding experience on z/OS UNIX System Services and interfaces in modern programming languages.

This support requires z/OS V2R3 or later.

Steps for the system programmer

Follow these steps to set up your z/OS server, which is the managed (target) node:

  1. Enable OpenSSH and perform ssh-keys setup.
  2. Install IBM Open Enterprise SDK for Python.
  3. Install IBM Z Open Automation Utilities (ZOAU).

For detailed version number requirements read the requirements documentation.

Decide how you want to install the Red Hat Ansible Certified collection.
  • Ansible Galaxy: If your organization has access to Ansible Galaxy or Ansible Automation Hub, you can install directly from the public repositories.

    Use the following ansible-galaxy command to install a collection hosted in Galaxy on your control node:

    $ ansible-galaxy collection install ibm.<collection>

    Find the correct installation command for the Red Hat Ansible Certified Content for IBM Z collection you are interested in on that respective collection's Ansible Galaxy page.

    Ansible Galaxy install

  • Automation Hub and Private Galaxy server: If your organization does not allow access to Ansible Galaxy or Automation Hub, then you might set up an internal Galaxy server and pull the approved content to share internally so that you can host a subset of content. You can modify the configuration to point to your internal Galaxy server.

    To configure access to Automation Hub and Private Galaxy server, use the same instructions that you use to configure your client to point to Automation Hub. When hosting a private Galaxy server or pointing to Hub, the available content is not always consistent with what is available on the community Galaxy server.

    Galaxy contains our community editions which represent our latest features and their progression to becoming certified in Automation Hub. Populating a private Galaxy repository depends on your particular scanning and content cloning process.

    Automation Hub and Private Galaxy server

  • Local installation: You can use the ansible-galaxy collection install command to install a collection built from source. To build your own collection, you must clone the Git repository, build the collection archive, and install the collection. The ansible-galaxy collection build command packages the collection into an archive that can later be installed locally without having to use Hub or Galaxy.

    Local installation

Steps

Follow these steps to install or update Ansible on your Automation Controller. Then install the z/OS core collection from Ansible Galaxy.

Install Ansible
  1. Install Python 3.5 or later.
  2. Install Ansible on your local machine.

    $ sudo pip3 install ansible

  3. Verify that Ansible is installed on your machine.

    $ ansible --version

Example output:

ansible 2.9.6 config file = None configured module search path = ['/Users/<username>/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.7/site-packages/ansible executable location = user/local/bin/ansible python version = 3.7.4 (default, Sep 7 2019, 18:27:02) [Clang 10.0.1 (clang-1001.0.46.4)]


Updating Ansible

If you already have Ansible installed on the Automation Controller, you can update it to the latest version.

  1. Update Ansible.
    $ sudo pip3 install ansible –upgrade
  2. Verify that Ansible is updated.

    $ ansible --version


Install the z/OS core collection

Once you have Ansible installed, use the following command to install the Red Hat Ansible Certified collection:

$ ansible-galaxy collection install ibm.<collection>

Use Red Hat Ansible Certified Content for IBM Z collections to automate tasks on your IBM Z environments. Start by referring to the included module documentation and examples provided with each of our modules. Use the ansible-doc command to view the documentation to learn about each of the modules, such as zos_data_set, by issuing ansible-doc ibm.ibm_zos_core.zos_data_set or by visiting the module documentation page.

With Red Hat Ansible Certified Content for IBM Z, documentation for all of your collections are in a single unified place. Explore documentation content across all IBM Z collections, including getting started and troubleshooting information specific to IBM Z environments.

An Ansible playbook consists of organized instructions, referred to as tasks and roles, that define work for a managed node (host) to be automated using Ansible.

To get started automating on IBM Z with playbooks tailored to many IBM Z use cases, there is the Ansible content for IBM Z sample playbook repository. Users can then edit these samples to fit their own needs, accelerating use and adoption of ansible amongst teams. You can also contribute playbooks to the sample playbook repository to help the community learn Ansible.

Let's start with this sample playbook from the Ansible for IBM Z sample playbooks repository as an example. This playbook performs the following steps:

  1. Create a data set and populate with JCL on the target z/OS system
  2. Submit job on z/OS
  3. Query job submission and review output
  4. Delete data set to clean up the z/OS system
Steps

Follow these steps to run a playbook:

  1. Edit the ansible.cfg file to include pipelining = true.
  2. Modify the sample inventory to add the z/OS host, user, and Python location.
  3. Update the host_vars in the zos_host.yml file to point to locations on ZOAU and Python on z/OS.
  4. Run the Ansible playbook using the following command:

    ansible-playbook -i inventory <sample>.yaml

You've just run your first Ansible playbook for IBM Z!

Frequently asked questions Q: What are the benefits of using the Ansible for IBM Z collections?

A: Users are able to:
• Integrate IBM Z into an enterprise automation strategy in a consistent way
• Enable a common approach for hybrid applications and infrastructure management
• Enable transparent visibility of IBM Z automation when orchestrated by Ansible
• Drive best practices to manage automation in source control to move towards infrastructure as code
• Leverage Ansible and Python skills, which are readily available in the marketplace and can be applied to z/OS
• Use modules to codify key maintenance and operational tasks for IBM Z software so that you can focus on what you’re trying to accomplish, rather than worry about how to write JCL, for example

Q: Where do I get support for the Red Hat Ansible Certified Content for IBM Z?

A: Red Hat® Ansible Certified Content for IBM Z collections will be developed in the open, and when content is ready for use it is released to Ansible Galaxy for community adoption. Content in Ansible Galaxy is supported by the robust open source community who recognizes Ansible as a leader in automation. Once contributors review community usage, feedback, and are satisfied with the content published, the collection will then be released to Ansible Automation Hub as certified and IBM supported for Red Hat® Ansible Automation Platform subscribers.

Q: Will more collections be available?

A: Absolutely! More collection and content will be made available in support of middleware provisioning, middleware configuration, middleware management, and application deployment, to name a few. The collections are starting with a focus on z/OS but are intended to expand more broadly to the IBM Z ecosystem over time. Ansible Galaxy contains the complete list of collections.

These content collections are accelerators to make automating z/OS with Ansible even easier. Ansible is a powerful tool, that can be used out of the box to build your own automation. With Python as the core language for Ansible modules, it's easy for developers to build and contribute their own modules in support of any automation strategy.

Q: Do I need to be an Ansible expert to use Ansible for IBM Z collections?

A: Ansible is a powerful IT automation tool that is quick and easy to learn. Get started by checking out Ansible's Getting Started website.

Q: Is there an easy way to get started working with the collections?

A: Yes, use the sample playbooks in the sample playbooks repository that leverage IBM Z collections. Consider contributing playbooks to the repository to help the Ansible for IBM Z community grow.
z/OS core
IMS collection
CICS collection
HMC collection
IBM Z System Automation
z/OSMF collection

Q: Ansible can cover a lot of use cases: some of which I already have some technology solutions for. Does Ansible replace any existing technologies I already use?

A: It is up to each enterprise to determine its strategy for how it evolves the set of tools and technologies that it uses. The good news with Ansible is that it integrates with a wide range of technologies across the hybrid multicloud landscape, and across IBM Z. You can use Ansible automation to integrate with what you have or build new playbooks with certified collections to create something new.

Leverage your existing JCL, REXX, and z/OSMF assets or most anything else using Ansible as the driver to automate Z. The choice is yours.

Learn more about Ansible Orchestration
The Ansible for IBM Z portfolio Ansible for IBM Z serves as the umbrella brand for a set of mainframe-related Ansible automation offerings, organized by level of certification, ownership, and intended use.

These collections are Red Hat certified and designed for production use in IBM Z environments. They provide supported modules, roles, and plugins aligned with IBM Z system interfaces and best practices.

Available certified collections include:

Support model:
Red Hat certified
Fully supported by IBM

Validated content builds on certified collections to deliver prescriptive automation solutions and proven patterns for real world use cases. This content accelerates adoption by showing how components work together in practice.

This content includes:

  • Operational blueprints and patterns – Validated architecture examples
  • Event Driven Ansible for IBM Z – Integrations that respond automatically to system events

Support model:
Validated to work by IBM only
Best practice guidance
Unlike Certified Content, Validated Content is not supported by Red Hat or IBM.

Real time automation and closed loop operations

Event Driven Ansible extends automation beyond scheduled or manual execution by enabling real time responses to events from IBM Z systems and tools that are monitored by Ansible rulebooks.

By connecting event sources to Ansible rulebooks, teams can automatically detect conditions and trigger remediation workflows which help reduce manual intervention and improve operational resilience.

Typical use cases include:

  • Automated response to system or middleware events
  • Real time remediation for exceeding operational thresholds
  • Closed loop automation combining monitoring, decision logic, and action.

Event Driven Ansible for IBM Z is delivered as part of Validated Content. It is available within Red Hat Automation Hub.

Red Hat Ansible Automation Platform Catalog – Validated Collections

Sample playbooks provide examples and starting points to help teams learn Ansible automation concepts for IBM Z.

Support model:
Educational content only
Best practice guidance

https://github.com/IBM/z_ansible_collections_samples

Technical resources Learn more about Ansible Automation with IBM z/OS Find more info at Red Hat Explore z/OS collections from IBM in Ansible Galaxy Explore the collections Learn about Ansible Automation Hub and certified content Check out the webinar Getting started with Ansible Get started now Ansible for IBM Z: User Spotlight Series New Check out user stories in the blog Explore Ansible for z/OS through IBM Z Trial Get hands on z/OS user management with Ansible Read the blog Red Hat Ansible Automation Platform Self-guided labs Get hands on z/OS Certificate Management automation with Ansible Watch the video IBM Z Trial New Evaluate IMS and Red Hat Ansible Certified Content for IBM Z Ansible for IBM Z Community Guild New Join calls, watch replays, and enroll for the latest updates What's new

• Updated introduction and added The Ansible for IBM Z portfolio section.

• Minor editorial changes were made.

• The link to the community in the Introduction section was updated.

• Minor editorial updates.

• The FAQ section was updated with links to information on getting started with the IMS and CICS collections.
• The Technical Resources section was updated with the addition of the Ansible for IBM Z Community Guild and the IBM Z Trial for IMS and Red Hat Ansbile Certified Content for IBM Z. The link for the IBM Z User Spotlight Series was changed.

• Updates to the introduction, including more information about collections, and changes and additions to the Technical resources section.

• Minor updates to the introduction, including the addition of z/OSMF to the list of collections.
• Updated documentation link to point to the sample playbook for z/OSMF

• Major content update with additional technical resources and link to IBM Z Trial
• Updated documentation links to point to the sample playbook for
• Released the IBM Z System Automation Collection, IBM z/OS CICS Collection, IBM Z Hardware Management Console Collection

• Updated the Ansible prerequisites section to include IBM Python
• Introduced a What’s New section
• Included a link to a Terminal Talk Podcast “Ansible for z/OS”

Released IBM z/OS IMS collection v1.0.0-beta1 and beta2 to automate routine system operation tasks with Ansible. The IMS collection facilitates database administration tasks and integrates application changes into a CI/CD pipeline for application deployment and delivery and more.
Read the blog

Released IBM z/OS core collection v1.1.0-beta1 to extend the library of Ansible modules to provide the ability to automate several operations including data access, encode data on z/OS and more.
Read the blog

Released of IBM z/OS core collection v1.0.0, as part of the Red Hat Ansible Certified content for IBM Z. IBM z/OS core collection enables automating development and deployment of your new applications and features in z/OS.
Read the blog