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 openshift-applier is an Ansible role, that uses your local OpenShift command line tools (oc) to process and apply templates into OpenShift.

Please feel to contribute!

Introduction to OpenShift-Applier

Step 1 of 10

Step 1

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

oc login -u developer -p developer

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