Difficulty: Intermediate
Estimated Time: 20-30 minutes

This tutorial will help you gain an understanding of the Infrastructure-as-Code paradigm with Ansible & OpenShift.

The openhift-applier is an Ansible role, that uses your local OpenShift command line tools (oc) to process and apply templates into OpenShift.

To understand some of the base knowledge and background behind applier, we recommend the following resources:

Introduction to OpenShift-Applier

Step 1 of 9

Step 1

To get started, let us login to the OpenShift cluster by running the following:

oc login -u developer -p developer

Now let's verify that you're logged in as a developer note: due to a temporary Katakoda bug, you may have to issue the oc login command twice

oc whoami

Output should be as follows:


To begin, let's create a new directory and go into it.

mkdir sample-applier; cd sample-applier

To complete the generic project structure, we want to create the rest of these:

├── inventory
│   ├── group_vars
│   │   └── all.yml
│   └── hosts
├── params
│   ├── ruby
│   └── projectrequests
├── projectrequests
├── requirements.yml
└── templates
    ├── app
    └── project

Let's go ahead and create that structure:

mkdir -p inventory/group_vars params/{ruby,projectrequests} templates/{app,project}

And now the files:

touch inventory/group_vars/all.yml inventory/hosts requirements.yml