Lift common behaviour around path handling in config object

The installer and broker paths share similar behaviours; this lifts the
commonality into a single function and invokes it from both.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Implement the "broker" abstraction for filesystem broker content

This adds a Razor::Broker class that wraps the filesystem based broker
content: configuration data, installation scripts and templates, and other
parts of the on-disk component are managed from this class.

This is not the "broker" referenced from a policy; that is an "instantiation"
of these brokers into the database -- still to be written -- that turns the
configuration data into a record of the chosen configuration, and otherwise
ties in with the rest of the running configuration.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Implement the database side "broker" entity

This reflects the instantiated version of the broker: when a user creates an
instance of the broker from the on-disk representation, they do so by giving a
name to the instance, and setting configuration parameters.

This stores the parameters, and the relationship with the on-disk object, to
allow the system to be aware of the users desired relationship.

This is not yet usable, only the container to ultimately hold the data.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Expose broker configuration values to the node install script template

This ties together the "instance" of the broker from the database, and the
representation of the in-memory broker, to be able to produce an
installation script.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Provide a shortcut from the broker instance to the installer script

This provides a shortcut for the most common operation: given this node, and
this broker instance, give me the installation script to run on the node.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Import `fabrication` gem for building database objects

This replaces the hand-coded object creation code in spec_helper with
Fabricator helpers.  These quickly build database objects to spec, making it
easier to get the data we need.

The primary advantage is that Fabrication provides native support for, eg,
sequences, creating multiple objects, and distinct classes of objects
being created.

This replaces the hand-coded version that was growing steadily in complexity
toward the same capabilities.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Bind brokers to policies

This adds a broker relationship to the policy table, and enforces that every
policy has a broker to ultimately hand off control to.  This mirrors the
current Razor behaviour.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Implement `create_broker` command

This adds the `create_broker` command, which creates an appropriate instance
of the broker based on the on-disk configuration.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Implement validation of configuration schema for brokers

This updates the broker code to finally implement validation of the
`configuration` data the user supplies.  That is now checked against the
schema supplied by the on-disk broker, and in the case of an error the
instance is treated as invalid.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Implement broker collection and object viewing

This implements the broker collection API, and provides access to the
currently defined set of brokers.  This includes validation that the returned
JSON conforms to our expectations.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>