Force Sinatra version above minimum

On earlier versions of Sinatra, the initrd.gz download for e.g. Ubuntu would
hang at a specific percentage because the Content-Length was not being
included. This was fixed in version 1.4.4, and so this gem should be pinned
to this version or later.

Fixes https://tickets.puppetlabs.com/browse/RAZOR-374
(Non-functional): CRLF fix

The WIMBOOT-LICENSE.txt file had the wrong EOL setting. This changes it to
the more default LF line ending character.
Updating Shiro framework

This includes a security release to shiro-core.

https://tickets.puppetlabs.com/browse/RAZOR-376
Set node_name for chef broker to avoid problems with hostname changes during provisioning
Pass Razor node.metadata key/value pairs to chef-client
Allow migration to specific revision in razor-admin

One feature that will be helpful for development is the ability to migrate
forward and backward. This adds a '-r'/'--revision' flag for the
`migrate-database` command in `razor-admin`.

For https://tickets.puppetlabs.com/browse/RAZOR-367
Refactoring database migration to avoid forward references

The last migration included the application rather than just making direct
calls to the database. That could be problematic when entities change, since
former migration scripts may no longer work. To resolve the forward
reference, this change refactors the old migration to direct database calls.

For https://tickets.puppetlabs.com/browse/RAZOR-367
Create top-level 'events' collection

In order to track when certain events fire in Razor, we need to add a new
collection to house these events. The 'events' table will do this, taking
over the duty of the former 'node_log_entries' table.

Fixes https://tickets.puppetlabs.com/browse/RAZOR-367
Add fedora/el-7 systemd support

This updates the packaging and adds a systemd service file
and supporting files to support systemd on Fedora >= 18 and
EL >= 7.

In addition to the razor-server.service file itself, the
razor-server-tmpfiles.conf used the systemd tmpfiles.d
mechanism to ensure that the /run/razor-server
directory is created on boot with the proper ownership
as /run is now using tmpfs.

The /usr/share/razor-server/razor-server.env file
simply wraps up environment variables that were
being set in the init script in a form suitable
for systemd.
Added CoreOS task to Razor.

Allowing for full clusters of CoreOS to be deployed, automatically
configuring the setup with heavy use of Razor's node-metadata function to
enable features like etcd configuration, fleet metadata, formatting of
drives and automatic addition of SSH keys. Since the node-metadata is
applied on all nodes, their value can easily be updated with different
settings on a per-node basis if wanted.
Chef broker: remove extraneous 'chef-client'

The install.erb for teh Chef broker had an extraneous 'chef-client' in
it. That has been removed.

Change suggested by Nick Douma

Fixes https://tickets.puppetlabs.com/browse/RAZOR-209
Documentation and sample hooks

This outlines the expected behavior of hooks.

For https://tickets.puppetlabs.com/browse/RAZOR-368
Add hooks as first-class objects

Hooks are a way to augment Razor with functionality when certain events occur.
Most/all hooks will involve node events, e.g. binding to a policy.

When a hook runs, it receives (as JSON) some metadata about the node and the
hook. When the hook finishes running, it can do several things:
- Exit with various status codes; 0 means success, any other means failure.
This will be recorded temporarily in the hook and permanently in the generated
event.
- Write to stdout; This can be either JSON or any string. If the string is
not JSON, it will be included in the generated event. If it is JSON, the
'hook' key can update the configuration of the hook; the 'node' key can
update the metadata of the node; the 'error' key holds any error(s) generated
by the hook; and the 'output' key holds any extra messages to include in the
generated event.

A generated event will be created whenever a hook's event script finishes
running.

Fixes https://tickets.puppetlabs.com/browse/RAZOR-368
Add `create-hook` and `delete-hook` commands

This adds methods for instantiating and deleting the configuration for a hook.

Fixes https://tickets.puppetlabs.com/browse/RAZOR-368
Triggering hooks for certain events

This adds hooks for node-unbound-from-policy, node-bound-to-policy,
node-deleted, node-booted, node-facts-changed, and
node-install-finished

Fixes https://tickets.puppetlabs.com/browse/RAZOR-369
Add `razor hooks` query

The user needs to see which hooks have been instantiated in the application.
This new command will return that list and display the configuration for
each.

Fixes https://tickets.puppetlabs.com/browse/RAZOR-368
View log for hook

`/api/collections/hooks/$name/log` will now yield all events for that particular hook.

For https://tickets.puppetlabs.com/browse/RAZOR-368
Source node chef name from hostname per @jrosenboom puppetlabs/razor-server#250
Fix `razor-admin` when run from different directory

If the directory where a user runs the `razor-admin` command
contains its own Gemfile, that Gemfile was being used instead
of razor-server's. This script will now change directories into
the razor-server directory in code.

Fixes https://tickets.puppetlabs.com/browse/RAZOR-356
Asynchronous execution of hooks

Hooks could potentially be long-running. Previously, hooks
were run sequentially, meaning the hook must complete
before the original event can show as completed. That means
that e.g. the delete-node command would not finish/return
until all hooks for that event have completed.

Hooks will be executed sequentially on their own singleton
queue, and arguments (node, hook config, policy) will be
cached and then reloaded if necessary prior to running the
hook.

Fixes https://tickets.puppetlabs.com/browse/RAZOR-370