Ansible on Mainframe
Abhishek Verma
Mainframe Modernization Go-to-market Leader Professional Services EMEA | Enterprise Transformation & Cloud Consulting
What is Ansible?
Ansible is an open source automation platform. It is very simple to setup and yet powerful. Ansible can help you with configuration management, application deployment, task automation. It can also do IT orchestration, where you have to run tasks in sequence and create a chain of events which must happen on several different servers or devices. Ansible is rapidly rising to the top in the world of automation tools. Let’s look at some of the reasons for Ansible’s popularity.
What Ansible can automate?
- Provisioning: Set up the various servers you need in your infrastructure.
- Configuration management: Change the configuration of an application, OS, or device; start and stop services; install or update applications; implement a security policy; or perform a wide variety of other configuration tasks.
- Application deployments: Make DevOps easier by automating the deployment of internally developed applications to your production systems
Advantages of Using Ansible
Free: Ansible is an open-source tool.
Very simple to set up and use: No special coding skills are necessary to use Ansible’s playbooks.
Powerful: Ansible lets you model even highly complex IT workflows.
Flexible: You can orchestrate the entire application environment no matter where it’s deployed. You can also customize it based on your needs.
Agentless: You don’t need to install any other software or firewall ports on the client systems you want to automate. You also don’t have to set up a separate management structure.
Efficient: Because you don’t need to install any extra software, there’s more room for application resources on your server.
Features of Ansible
- Open Source
- Written in python, so it’s easy to read and extend
- Easy installation and configuration
- Highly Scalable
- Agent less client configuration
Requirements of Ansible
- SSH Client
- Python
Components of Ansible
Ansible Playbooks – The real strength of ansible is that it all lies in its playbooks. A playbook is like a recipe or an set of instructions which tells Ansible what work it has to do when it connect to new machine. Playbooks are written in YAML, which simply could be viewed as XML.
For Example – if we have a group of web servers, database servers and monitoring servers and if we decide to add a web server then we will fire our playbook which is set of instructions, ansible will then install and configure web server and will make sure that our database allows connection from the new server and then it will add new server to our network monitoring solution.
- Plays – playbook contain plays. Plays are generally a group of tasks that are performed on defined hosts to perform defined functions.
- Tasks – Tasks are action carried out by playbooks.
- Roles – A role is bundling automation content and making it reusable.
Roles are organizational components that can be assigned to set of hosts to organise tasks.
- Handlers – Handlers are similar to tasks except that a handler will be executed only when it is called by an event.
- Templates – Templates are files based on Python’s Jinja2 template engine and have .j2 extension.
Why developers should choose Ansible
- Agentless
- Great configuration
- Simple
- Powerful
- Easy to Learn
- Flexible
Ansible on Z Mainframe
It’s no mystery that automation is the heartbeat of a successful platform, and it’s no different for IBM z/OS. The exciting news is that Ansible is now available on mainframes as IBM z/OS Ansible, and it enables users to automate z/OS applications and IT infrastructure. It will also enable users to automate development and operations through unified workflow orchestration across platforms. And that makes it a DevOps tool. It can work with existing JCL, REXX, and z/OSMF assets.
Delivered as a fully supported solution via Ansible Content Collections, plugins and modules, Red Hat Ansible Certified Content for IBM Z provides easy-to-use automation building blocks that can accelerate the automation of z/OS and z/OS-based software. The initial core collections include connection plugins, action plugins, modules, and a sample playbook to automate common tasks on z/OS such as:
- zos_data_set: Create, delete, and manage attributes for data sets
- zos_job_query: Query z/OS for a list of jobs
- zos_job_submit: Submit a job and optionally monitor for its completion
- zos_job_output: Capture the job output for a submitted job
What is needed to run Ansible on Mainframe?
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.
Why IBM z/OS?
Consistency
- Enable a common approach to hybrid applications and infrastructure management
- Integrate z/OS into an enterprise automation strategy in a consistent way
Transparency
- Enable transparent visibility of z/OS automation when orchestrated by Ansible, which can help to break down silos between IT teams
- Use best practices to manage automation in source control to move towards infrastructure as code
Skills
- Use 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 z/OS software so that you can focus on what you’re trying to accomplish