Skip to content
Joel edited this page Aug 19, 2014 · 6 revisions

rancher

I am rarely happier than when spending entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand

-Douglas Adams, Last chance to See

Created to simplify the process of creating Packer templates for Vagrant boxes.

Rancher creates Packer templates for consumption by Packer. The Rancher representations of Packer templates are called builds. Rancher builds allow for customization of Packer templates, including specifying external resources, like scripts, that are required by the template. This makes it easy to generate consistent Packer templates using the latest version of the distros and Package them for distribution. Packer is still responsible for transforming the templates to artifacts.

Rancher was started because, for VirtualBox and VMWare builders, a lot of the setting are the same. For ISO configuration, the current Packer template creation process requires manual look-up and configuration of the various settings. These are things I'd rather have a program worry about than do myself, especially since Packer templates are in json. Throw in support for various releases for each distribution and it really starts looking like something a program should be handling.

Rancher aims to simplify that by having sane defaults that are consistent with Vagrant conventions, except for RAM and HD allocations, that are easy to override for generation of customized artifacts that target either VirtualBox or VMWare and that Vagrant can use.

Rancher uses TOML for its configuration files, except for rancher.cfg. The builds can contain variable references to make custom string building easier. Rancher uses the colon, : to prefix supported variables. This is to prevent collision with Packer named variables, which rely on Go's lexing system using {{ and }}. Any templating within a build configuration is preserved by Rancher during Packer template generation.

Only currently supported releases by Rancher supported distributions can be used as Rancher looks up the iso URL and checksum information for each Rancher builds release iso. For distributions that use mirrors, like CentOS, Rancher will randomly pick a mirror for the requested release iso. This can be overridden if a specific mirror is desired.

Scope always expands

Even though the original purpose was to simplify the creation of Packer templates for Vagrant boxes, Rancher is continuously expanding its support for Packer. The goal is to be able to generate Packer templates for all Packer supported builders, post-processors, and provisioners. This includes all variable support, with a few exceptions.

Packer templates consist of four sections, which can contain 0-many elements: builders, post-processors, provisioners, and variables. Rancher currently supports builders, post-processors, and provisioners. For the most part, as long as a variable can be represented in TOML, it is supported by Rancher.

For each section element, Rancher will ignore any variable that is not supported by the section element in question.

##Rancher Build## Rancher builds are TOML based Packer build configurations. They consist of a build name, the release settings for that build--at minimum the distro name, i.e. build type for Packer--and any overrides to the distribution's default settings that are to be applied to that build. Build names are used for Rancher build lists and to specify specific build configurations when using the build sub-command.

###Notes:### Not all Packer variables and options are supported. If additional functionality is needed, please add it, or file an issue, at least.

Please report any problems or inaccuracies.