CORD platform-install

This repository contains Ansible playbooks for installing and configuring software components that build a CORD POD: OpenStack, ONOS, and XOS.

It is used as a sub-module of the main CORD repository, but can independently bring up various CORD profiles for development work.

If you want to set up an entire CORD pod on physical hardware, or set up the Cord-in-a-Box deployment, you should start at the CORD repository.

Using platform-install for development

Bootstrapping your development environment

There's a helper script, scripts/cord-bootstrap.sh. that will install development environment prerequisites on a Ubuntu 14.04 node. You can download it with:

curl -O ~/cord-bootstrap.sh https://github.com/opencord/platform-install/raw/master/scripts/cord-bootstrap.sh

Running the script will install the repo tool, Ansible, and Docker, as well as make a checkout of the CORD manifest into ~/cord.

You can specify which gerrit changesets you would like repo to checkout using the -b option on the script as documented here.

Once you have done this, if you're not already in the docker group, you should logout and log back into your system to refresh your user account's group membership. If you don't do this, any docker command you run or ansible runs for you will fail. You can check your group membership by running groups.

Once you log back in, you may want to run tmux to maintain a server-side session you can reconnect to, in case of network trouble.

All of the commands below assume you're in the cord/build/platform-install directory.

Credentials

Credentials will be autogenerated and placed in the credentials/ directory when the playbooks are run, where the credential name is the filename, and the contents of the file is the password.

For most profiles the XOS admin user is named xosadmin@opencord.org.

Development Loop

Most profiles are run by specifying an inventory file when running ansible-playbook. Most of the time, you want to run the deploy-xos-playbook.yml playbook.

For example, to run the frontend config, you would run:

ansible-playbook -i inventory/frontend deploy-xos-playbook.yml

Assuming it runs without error, you can then explore the environment you've set up. When you're ready to tear down your environment, run:

ansible-playbook -i inventory/frontend teardown-playbook.yml

This will destroy all the docker containers created, and delete the ~/cord_profile directory.

You can then re-run, or run a different profile.

Creating a new CORD profile

To create a new CORD profile, you should:

  1. Create an inventory file in inventory/ that defines the cord_profile variable, with the name of your profile.
[all:vars]
cord_profile=my-profile
  1. Create a .yaml variables file in profile_manifests/ with the name of your profile (ex: my-profile.yaml), and populate it with your configuration.

  2. To test the profile, run the deploy-xos-playbook.yml playbook using your inventory profile: ansible-playbook -i inventory/my-profile deploy-xos-playbook.yml

Making changes and lint checking your changes

Before commit, please run ./scripts/lintcheck.sh . in the repo root, which will perform the same ansible-lint check that Jenkins performs when in review in gerrit.

Specific profiles notes

api-test

This profile runs API tests for both the REST and TOSCA APIs. This can be done in an automated fashion:

ansible-playbook -i inventory/api-test api-test-playbook.yml

The XOS credentials in this config are padmin@vicci.org and letmein (until the tests are modified to support generated credentials).

frontend

Builds a basic XOS frontend installation, useful for UI testing and experimentation.

mock-rcord, mock-mcord

Builds a Mock R-CORD or Mock M-CORD pod, without running service synchronizers in a manner similar to frontend.

opencloud

Used as a part of the OpenCloud deployment. Similar to rcord.

rcord

Used as a part of the R-CORD deployment. Sets up infrastructure pieces including OpenStack (via Juju) and ONOS as well as XOS.