Difficulty: beginner
Estimated Time: 30 minutes

This section will give a brief overview of the Ansible Operator with a step-by-step example of developing an Ansible Operator using Operator SDK.

The reader is expected to have a basic understanding of the Operator pattern.

  • Ansible Operator is an Operator which is powered by Ansible.
  • Custom Resource events trigger Ansible tasks as opposed to the traditional approach of handling these events with Go code.

Ansible Operator development and testing is fully supported as a first-class citizen within the Operator SDK. Operator SDK can be used to create new Operator projects, test existing Operator projects, build Operator images, and generate new Custom Resource Definitions (CRDs) for an Operator.

By the end of this section the reader should have a basic understanding of:

  • What the Ansible Operator is
  • How the Ansible Operator maps Custom Resource events to Ansible code
  • How to pass extra variables to Ansible code via the operator
  • How to leverage existing roles from Ansible Galaxy
  • How to deploy and run the Ansible Operator in a OpenShift cluster
  • How to run the Ansible Operator Locally for development

Thank you for taking a closer look at the Ansible Operator. For more Information, check out the links below:

Git Hub




Ansible Operator Overview

Step 1 of 9

The Ansible Operator

This step doesn't require changes to the interactive environment, but feel free to explore.

Why an Operator?

Operators make it easy to manage complex stateful applications on top of Kubernetes. However writing an operator today can be difficult because of challenges such as using low level APIs, writing boilerplate, and a lack of modularity which leads to duplication.

The Operator SDK is a framework that uses the controller-runtime library to make writing operators easier by providing:

  • Extensions to cover common operator use cases

What is an Ansible Operator?


Included in Operator Framework

Ansible Operator is one of the available type of Operators that Operator SDK is able to generate. As of Fall 2018, Operator SDK assists with Golang, Helm, and Ansible

How do I use it?


Ansible Operator Flow

The following workflow is for a new Ansible operator:


Now, let's dig into the specifics and walk through an example.