Skip to content

Packer templates for building & deploying Vagrant & OVA with StackStorm installed

License

Notifications You must be signed in to change notification settings

StackStorm/packer-st2

Repository files navigation

StackStorm Vagrant & OVA

Latest Build Latest Release Download from Vagrant Cloud

Packer templates with InSpec integration tests for building Vagrant box & OVA image with StackStorm community installed. Fully tested and packaged artifacts are produced during the build pipeline.

Usage

Vagrant Quick Start

Starting a Vagrant VM is easy:

vagrant init stackstorm/st2
vagrant up
vagrant ssh

Updating the Vagrant box

Once we release a newer version, Vagrant will warn you about the available update. To update the box:

vagrant box outdated
vagrant box remove stackstorm/st2
vagrant up

OVA Virtual Appliance

Virtual appliance is available for download as .OVA image from the Github Releases page.

Linux login credentials:
Username: vagrant
Password: vagrant

StackStorm login details:
Username: st2admin
Password: Ch@ngeMe

At the moment only Virtualbox provider is supported. VMWare-compatible virtual appliance is available with StackStorm Enterprise (EWC) image. Ask StackStorm Support for more info.

st2-integration-tests

Sometimes StackStorm does not run properly for some reason.
Discovering why at a infra level is the responsibility of st2-integration-tests which will perform StackStorm InSpec Tests and report back with more detailed info.
This can save time for both user & engineering team to avoid extensive troubleshooting steps.

If something went wrong, - just run st2-integration-tests!

Building Vagrant & OVA

Requirements

The following tools are required for the build process:

Build Steps

  • Run Packer via make build

The Packer build process will import Ubuntu 18.04 Bionic Server iso image in Virtualbox, bootstrap Ubuntu server with all the required settings (automating typical iso live CD install steps), install & configure StackStorm and finally export both the Vagrant box and .OVA image into the /builds directory.

See st2.json which codifies Packer build pipeline and could be used as a source of entire automation logic.

Build params

There are environment variables you can pass to control the StackStorm version and box/image version.

  • ST2_VERSION - x.y.z format, like 2.7.1 (default: latest st2 version)
  • BOX_VERSION - YYYYMMDD format, like 20180131 (default: today's date in UTC)

As a result, Packer will generate the box with version v2.7.1-20180131.

Testing

/test directory contains Integration tests, powered by InSpec.io Infrastructure Testing framework. Tests are performed at the end of the Packer build pipeline after entire installation and configuration. They ensure that custom OS Linux-level modifications are in place and StackStorm was really deployed, works correctly and alive with other services it relies on like RabbitMQ, MongoDB. To make testing close to a real-world scenario, an additional VM reboot step in the build pipeline is performed before running the actual integration tests.

Please don't forget to include respective tests for every new critical feature of the system!
See https://www.inspec.io/docs/reference/dsl_inspec/ and existing /tests examples which makes easy to add more tests.