swoop-inc/redisio — pull request #1 by ssimeonov (2013-09-29 11:49:59+00:00)
Title: Server configuration improvements

###Allows servers to be a Hash or Array

Chef best practices recommend that node attributes are kept in hashes
because of the sometimes confusing way array attributes are handled.
For example, there is no natural way to override the values inside
a hash which is part of an array attribute. This makes it difficult
to break up the configuration of Redis instances between roles,
environments and recipes.

The complications are obvious from the fact that both the README and
the code of the cookbook makes note of special handling related to
array attributes.

This commit allows hashes to be used instead of arrays while
maintaining full backward compatibility.

- Adds `RedisioHelper.each_server`, which acts as an adapter that yields
a server info `Mash` regardless of the underlying collection.

- Changes `servers` resource attribute type to `Enumerable`.

- Localizes `node.set` for `:servers` to the case when it is `nil`.

- Updates changelog.

- Updates README with server hash as the preferred syntax.

### Improves service administration

The main purpose of this commit is to improve service management,
especially with init.d and to harden the cookbook such that it
can work well in environments where nodes are converged many times.

- Adds restart notifications when templates change. Due to the order
in which execution happens right now, the notifications are
conditional because the service resource many not have been
created. Refactoring service creation would have made the commit
substantially more complicated.

- Extracts duplicated logic related to server, service and resource
naming into the helper module. Fixes the edge case when the service
name begins with "redisredis".

- Adds restart action natively to the init.d script so that it
can be used by node admins directly, as needed.

- Adds convenience Redis admin commands to the init.d script. These
are especially useful when Redis uses token authentication. The
new commands are cli (start redis-cli), info (output of INFO command)
and monitor (start the MONITOR command).

- Updates changelog.