Plugins

In addition to specifying values in YAML environment files, there are other plugins that can also provide values to be used in your templates, and you can easily write your own. The plugins that ship with Tiller are :

Helper modules

You can also make use of custom utility functions in Ruby that can be called from within templates. For more information on this, see the developers documentation.

Ordering

This is an important point so I mention it here so it's more visible! You can use multiple plugins together, and Tiller lets you over-ride values from one data source with another.

Plugins can provide two types of values:

  • "global values" which are available to all templates
  • "template values" which are specific to a single template

Template values always take priority - If a template value has the same name as a global value, it will overwrite the global value.

When you load the plugins (covered below), the order you load them in is significant - the last loaded plugin will have the highest priority and over-write values from the previous plugin. For example, in short-form YAML:

data_sources: [ "defaults" , "file" , "environment" ]

The priority increases from left to right: Defaults will be used first, then the file data source, and finally any values specified as environment variables will over-write anything else.

In long-form YAML, the priority increases from top to bottom:

data_sources:
  - defaults
  - file
  - environment

So, to summarise: A template value will take priority over a global value, and a value from a plugin loaded later will take priority over any previously loaded plugins.