OpenConext Deployment: Part #2

In part one, I talked about what myUnifiED is and the various tools Cybera has used to deploy it.

In this post, I’ll be covering how to create the repository for configuration management, and deploy infrastructure to support the OpenConext platform. To keep things simple, I’ll only create a single OpenConext server.

Ansible Inventory

Ansible has the ability to run dynamic inventories of servers and virtual machines in your environment. By using a plugin system, Ansible is able to inventory a wide range of different server types. The most popular are Cobbler, Amazon Web Services, and OpenStack, but Ansible supports many others as well. By using Ansible's inventory system, we can dynamically discover servers and even place them in common groups. I’ll demonstrate how this is useful shortly.

DNS

OpenConext requires several DNS records to be created prior to deployment. A list of these records can be found in the OpenConext-deploy wiki (they can either be A or CNAME records).

Installation on Linux 64-bit

Folder Structure

Note: To make things simple, I will be using a very flat folder structure. Cybera's actual environment is more complicated, since we run several instances of OpenConext (one for development, one for demoing, and one for production), and each has its own directory structure.

You can create the terraform folder and SSH keypair using the following commands:

mkdir terraform
cd terraform
ssh-keygen -t rsa -f id_rsa -N ''

Next, create a file called "main.tf" in the "terraform" directory. This file will declare the SSH key pair, security group, and virtual machine that Terraform will build. The fields under the OpenStack provider in main.tf need to be populated with your actual OpenStack credentials.

Replace <domain> with the domain name you used when creating your DNS records. The image_name and flavor_name may differ, so ensure these are changed to suit your OpenStack environment. I'll be using CentOS 7 for this deployment, which is the recommended Linux distribution for OpenConext in general.

Notice the “groups =” line above. This line instructs Terraform to tag the instance with those names in OpenStack. The Ansible OpenStack inventory script will use these metadata tags for two things: 1) To assign group variables (configuration settings that each server in the group should have), and 2) To connect to the instance to install and configure OpenConext. This is especially powerful when you start scaling up your infrastructure and only need to keep track of groups of instances instead of individual names.

Once everything is filled in, run terraform apply. Terraform will then create and build the OpenStack SSH keypair, security group, and virtual machine.

Once these pieces of infrastructure have been created, you’ll use Ansible to do the actual installation and configuration of OpenConext on the virtual machine. This will be shown in Part 3.