Adoptable Cookbooks List

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Serf Cookbook

Supports

Usage

Using the default attributes will setup a single Serf agent in its own cluster.

If you already have a Serf agent (or cluster) running specify the array of address(es) with the
node["serf"]["agent"]["start_join"] attribute so the agent will join the cluster(s).

What does the installation look like

By default the installation will look like,

/opt/serf/* - All of serf's files (config, binaries, event handlers, logs...)
/etc/serf/* - Link to all of serf's config files
/var/log/serf/* - Link to all of serf's log files
/etc/init.d/serf - An init.d script to start/stop the agent. You can use service
serf [start|stop|restart|status] instead

Event Handlers

An event handler is a script that is run when the Serf agent
recieves an event (member-join, member-leave, member-failed, or user).

You can configure an event handler via the attribute node["serf"]["event_handlers"]. The format of the event_handlers
attribute is the following,

Chef will download the event handler and ensure it stays up to date. It will also add it to the serf agent's list of event handlers.
Each event handler must have a unique name.

The event_type value filters the event handler for certain events. Use this doc
to figure out the event_type you need.

It is also possible to add event handlers via the attribute node["serf"]["agent"]["event_handlers"]. The node["serf"]["event_handlers"]
helps with the deployment of the event handler file itself and will add the event handler to the node["serf"]["agent"]["event_handlers"]
attribute.

Attributes

node["serf"]["user"] : The user that owns the serf installation (default="serf")

node["serf"]["group"] : The group that owns the serf installation (default="serf")

node["serf"]["agent"][*] : A hash of key/values that will be added to the agent's config file (default={}). Use this doc to configure the agent.

node["serf"]["event_handlers"] : An array of hashes that represent event handlers. See 'Event Handlers' above for more details (default=[])

node["serf"]["binary_url"] : The full binary url of the Serf agent. If you override this value make sure to provide a valid and up to date value for node["serf"]["version"] (default=File.join node["serf"]["base_binary_url"], "#{node["serf"]["version"]}_linux_#{node["serf"]["arch"]}.zip")

node["serf"]["base_directory"] : The base directory Serf should be installed into (default="/opt/serf")

node["serf"]["log_directory"] : The directory of the Serf agent logs (default="/var/log/serf")

node["serf"]["conf_directory"] : The directory of the Serf agent config (default="/etc/serf")