Ansible Tower and its ‘venv’ Lifecycle on OpenShift

Process overview

As we live in the beautiful world of GitOps, therefore the best and easiest way to store our environments would be GIT (GitLab, GitHub, BitBucket, gitea or any other preferred SCM). Each time when developers update their dependencies they follow the standard PullRequest procedure. After changes merged in master branch, Git can trigger Tekton WebHook to launch a pipeline, or it can be triggered manually.

High-level Pipeline Overview

Deploying pipeline

I use OCP 4.6 with pipelines 1.2.3 and assume it’s all up and running.
Create a new project/namespace

oc new-project tower
oc adm policy add-cluster-role-to-user cluster-admin system:serviceaccount:tower:pipeline
$ oc apply -k -n tower

configmap/ansible-inventory unchanged unchanged configured configured
Ansible builder pipeline in OpenShift UI

Running deployment

There are a few ways to trigger Tekton pipeline. WebHook — most advanced method when it will be launched Git action like (merge or commit); Pipeline UI in Openshift; Tekton CLI tool tkn (my preference)

tkn pipeline start ansible-build -w name=shared-workspace,volumeClaimTemplateFile=
Happy Path Output after Pipeline trigger
Ansible Tower version and new environments (Sure you need to apply Tower Subscription on the first login)

Upgrading version or virtual environment

As most of the parameters can be passed to Tekton as parameters on launch, we can easily re-run pipeline with a few arguments. As we agreed before, we are going to deploy a new version of Ansible Tower and keep the same virtual environments. Simply trigger new build:

tkn pipeline start ansible-build \
-p tower-image=3.8.3 \
-p ansible-installer= \
-w name=shared-workspace,volumeClaimTemplateFile=
Ansible Tower version was upgraded


Tekton is a very powerful tool that allows not only manage the application lifecycle but also useful for infrastructural tasks in a GitOps fashion.


Tekton Source code:
Ansible Automation Platfrom:
Ansible environments git:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store