Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

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.

Select Badges

Select Supported Platforms

Select Status


stack_commons (14) Versions 0.0.48

provides common supporting features for stacks

cookbook 'stack_commons', '= 0.0.48', :supermarket
cookbook 'stack_commons', '= 0.0.48'
knife supermarket install stack_commons
knife supermarket download stack_commons
Quality 0%


Supported Platforms

  • CentOS 6.5
  • Ubuntu 12.04
  • Ubuntu 14.04



  • apache2, >= 3.0.0
  • apt
  • build-essential
  • chef-sugar
  • database, >= 2.3.1
  • java
  • memcached
  • mongodb
  • mysql, ~> 5.0
  • mysql-multi
  • newrelic
  • newrelic_meetme_plugin
  • newrelic_plugins
  • nginx
  • openssl
  • percona-multi
  • pg-multi
  • php
  • platformstack
  • python
  • rabbitmq
  • rackspace_gluster
  • redis-multi
  • uwsgi
  • varnish
  • yum
  • yum-ius
  • yum-epel



  • what it does
    • nothing


  • what it does
    • sets up node['disk']['name'] with the filesystem specified in node['disk']['fs']


  • what it does
    • sets up glusterfs based on the node['rackspace_gluster']['config']['server']['glusters'] attribute
    • this may involve some manual setup, it is glusterfs afterall


  • what it does
    • sets up a percona master server node.


  • what it does
    • sets up a percona slave server node.


  • what it does
    • sets up memcache
    • sets up the memcache cloud monitoring plugin if enabled


  • what it does
    • sets up mongodb from the 10gen repo


  • what it does
    • calls stack_commons::format_disk to format a disk
    • creates the mysql user and manages the /var/lib/mysql mountpoint


  • what it does
    • sets a random root mysql password if the default password would normally be set
    • sets up mysql
    • sets up a holland user if node['holland']['enabled']
    • sets up a monitoring mysql user and monitor if node['platformstack']['cloud_monitoring']['enabled']
    • allow app nodes in the environment to attempt to connect
    • auto-generates mysql databases and assiciated users/passwords for sites installed (can be disabled)
    • installs specific databases (will autogenerate the user and password if needed still)
  • toggles
    • node[stackname]['db-autocreate']['enabled'] controls database autocreation at a global level
    • if the site has the db_autocreate attribute, it will control database autocreation for that site
  • info
    • auto-generated databases are based on site name and port number the site is on, same for username


  • what it does
    • installs holland
    • will set up a backup job based on if you are running as a slave or not


  • what it does
    • sets up mysql master (runs the mysql_base recipe as well)
    • will allow slaves to connect (via iptables)


  • what it does
    • sets up the mysql slave (runs the mysql_base recipe as well)
    • allows the master to connect (via iptables)


  • what it does
    • sets up newrelic client
    • sets up the application agent as defined in node['stack_commons']['application_monitoring'][app_type_goes_here]['enabled']
    • sets up the following plugins (as needed)
    • memcache
    • rabbit
    • nginx
    • toggles
    • node['stack_commons']['application_monitoring']['php']['enabled'] php application agent install
    • node['stack_commons']['application_monitoring']['python']['enabled'] python application agent install
    • node['stack_commons']['application_monitoring']['java']['enabled'] java application agent install


  • what it does
    • nothing


  • what it does
    • sets up a basic postgresql server and the associated monitoring checks (if enabled)
  • toggles
    • node['platformstack']['cloud_monitoring']['enabled'] controls the monitoring checks


  • what it does
    • sets up postgresql as a master
    • allows postgresql slaves to connect (via iptables)


  • what it does
    • sets up postgresql as a slave
    • allows the postgresql master to connect (via iptables)


  • what it does
    • allows nodes tagged as "#{stackname.gsub('stack', '')}_app_node" to connect (via iptables)
    • disables guest user
    • sets up the cloud monitoring plugin
    • sets up a monitoring user for rabbit (with password)
    • sets up rabbitmq vhost/user/password combinations for each vhost and port combination


  • what it does
    • sets up redis (basic)
    • allows nodes tagged as "#{stackname.gsub('stack', '')}_app_node to connect (via iptables)
    • allows nodes tagged as "#{stackname}-redis" to connect (via iptables)


  • what it does
    • sets up redis in a master capacity


  • what it does
    • sets up redis sentinel
    • allows nodes tagged as "#{stackname.gsub('stack', '')}_app_node" to connect (via iptables)
    • allows nodes tagged as "#{stackname}-redis_sentinel" to connect (via iptables)
    • allows nodes tagged as "#{stackname}-redis" to connect (via iptables)


  • what it does
    • sets up redis in a standalone capacity


  • what it does
    • sets up redis in a slave capacity


  • what it does
    • allows clients to connect to the varnish port (via iptables)
    • enables the cloud monitoring plugin for varnish
    • sets the default backend port to the first useful port it can find
    • sets up varnish if for multi backend load ballancing per vhost/port combination
  • toggles
    • node['varnish']['multi'] controls if varnish is simple or complex (multi backend or not)
    • it is also controled by if any backend nodes are found


No Data_Bag configured for this cookbook



  • default['stack_commons']['stackname'] = 'stack_commons'
    • this is the namespace we set stack specific attributes within
the following are namespaced attribues taken from the name above
  • default['stack_commons']['mysql']['databases'] = {}
    • contains a hash of database names to set up with users / passwords as the content
  • default['stack_commons']['rabbitmq']['passwords'] = {}
    • contains a hash of users with passwords as the value
  • default['stack_commons']['db-autocreate']['enabled'] = true
    • controls database autocreation for each site / port combination globally
  • default['stack_commons']['varnish']['multi'] = true
    • controls whether or not varnish is set up for multiple sites
  • default['stack_commons']['application_monitoring']['php']['enabled'] = false
    • controls application monitoring via php
  • default['stack_commons']['application_monitoring']['python']['enabled'] = false
    • controls application monitoring via python
  • default['stack_commons']['application_monitoring']['java']['enabled'] = false
    • controls application monitoring via java
and the rest
  • default['disk']['name'] = '/dev/xvde1'
    • used for disk auto format, lists the device to format
  • default['disk']['fs'] = 'ext4'
    • the filesytem you wish to use to format, you need to have mkfs.FS_TYPE installed
  • default['holland']['enabled'] = false
    • controls whether or not to use holland for backup of mysql
  • default['holland']['password'] = 'notagudpassword'
    • default password that holland uses to access the database for backups
  • default['holland']['cron']['day'] = '*'
    • how often we run the backup, every day by default
  • default['holland']['cron']['hour'] = '3'
    • what time during the day to run the backup, 3AM local server time by default
  • default['holland']['cron']['minute'] = '12'
    • what time within the hour that we run the backup, 12 minutes by default


  • default['stack_commons']['cloud_monitoring']['agent_mysql']['disabled'] = false
    • controls rackspace cloud monitoring for mysql
  • default['stack_commons']['cloud_monitoring']['agent_mysql']['alarm'] = false
    • controls if alerts get sent out
  • default['stack_commons']['cloud_monitoring']['agent_mysql']['period'] = 60
    • how often we want to check
  • default['stack_commons']['cloud_monitoring']['agent_mysql']['timeout'] = 15
    • how long we want to wait while sending checks
  • default['stack_commons']['cloud_monitoring']['agent_mysql']['user'] = 'raxmon-agent'
    • mysql user the agent check will connect as
  • default['stack_commons']['cloud_monitoring']['agent_mysql']['password'] = nil
    • mysql password the agent check will connect as
  • default['platformstack']['cloud_monitoring']['custom_monitors']['name'].push('mysql')
    • actually sets up the mysql monitor
  • default['platformstack']['cloud_monitoring']['custom_monitors']['mysql']['source'] = 'monitoring-agent-mysql.yaml.erb'
    • the template that the mysql monitor uses
  • default['platformstack']['cloud_monitoring']['custom_monitors']['mysql']['cookbook'] = 'stack_commons'
    • the cookbook that the template for mysql is sourced from
also contains a list of attributes to control rackspace cloud monitoring, for more information see


contains attributes that used in a demo site, useful as an example of what to set to deploy a site


  • default['rackspace_gluster']['config']['server']['glusters']['Gluster Cluster 1'] = {}
    • initializing the datastructure for controling glusterfs along with setting the cluster's name to 'Gluster Cluster 1'
  • default['rackspace_gluster']['config']['server']['glusters']['Gluster Cluster 1']['volume'] = 'vol0'
    • sets the volume to be used with 'Gluster Cluster 1'


contains a list of attributes a for setting up logging to elkstack

for more information see


  • default['stack_commons']['newrelic']['mysql']['user'] = 'newrelic-agent'
    • the user that newrelic uses to monintor mysql metrics
  • default['stack_commons']['newrelic']['mysql']['password'] = nil
    • the password that newrelic uses (nil means it's automaticly generated)


useful datastructures

  • databases json { "stack_commons": { "mysql": { "example_db": { "user": "exampleuser", "password": "do_not_use_this_password" } } } }


  • MySQL DB Single Node:
    "run_list": [

  • MySQL DB Master Node:
    "run_list": [

  • MySQL DB Slave Node:
    "run_list": [

  • PostgreSQL clustering

Ensure the following attributes are set within environment or wrapper cookbook

node['postgresql']['version'] = '9.3'
node['postgresql']['password'] = 'postgresdefault'
node['pg-multi']['replication']['password'] = 'useagudpasswd'
node['pg-multi']['master_ip'] = ''
node['pg-multi']['slave_ip'] = ['']

# Depending on OS one of the following two must be set:
node['postgresql']['enable_pdgd_yum'] = true  # (Redhat Family)
node['postgresql']['enable_pdgd_apt'] = true  # (Debian Family)
  • Master PostgreSQL node:
    "run_list": [

  • Slave PostgreSQL node:
    "run_list": [

Other Notes

New Relic Monitoring

To configure New Relic, make sure the node['newrelic']['license'] attribute is set and include the platformstack cookbook in your run_list. You can also run the stack_commons::newrelic recipe for some more advanced monitors.


Monitoring is set up only when platformstack is present. See platformstack's and attribute file on monitors.

New Relic Plugins

Due to a resource name conflict between elasticsearch and newrelic_plugins cookbook we are using a fork rather than the upstream cookbook. You need to get this fork or add the following lines to your Berkshelf file :

cookbook 'newrelic_plugins', git: ''

More details :



Authors:: Matthew Thode

stack_commons CHANGELOG

This file is used to list changes made in each version of the stack_commons cookbook.


  • Release without new stove/supermarket metadata


  • @martinb3 - Add back python workarounds


  • @martinb3 - Remove python workarounds


  • @prometheanfire - removed apache2 dep
  • @prometheanfire - switched from set_unless to default_unless
  • @cybermerc - locked mysql-multi version
  • @prometheanfire - fixed checks to look in stack_commons namespace not phpstack
  • @jujugrrr - Pinned down OpenSSL cookbook as the syntax changed, and there is a typo
  • @jujugrrr - Cleanup Berksfile to reflect a more current elkstack
  • @jujugrrr - Discovered a bug in serverspec checking for upstart services, see
  • @theborch - move to circleci testing platform
  • @prometheanfire - switch to using the mysql_chef_gem automatically now


  • @schwing - Remove conflicting rackops_rolebook
  • @bobross419 - change db naming to use underscores


  • @martinb3 - fix missing array initializer


  • Missing.


  • @cybermerc - added percona master/slave recipes
  • @prometheanfire - make the user actually 16 characters long (8 bytes in the function)
  • @prometheanfire - make sure the database name conforms to standards


  • @prometheanfire - change memcahce iptables rules to be search based
  • @prometheanfire - change mysql user to not be based off of site but instead be random hex (16 char)


  • @martinb3 - Fix python ordering a bit further


  • @martinb3 - Move python recipe out by itself, add workaround for #85


  • @cybermerc - Pin mysql cookbook to < 6 until mysql bits can be updated.


  • Release skipped.



  • @martinb3 - Fix logic bug / missing nil check


  • @martinb3 - Add feature to handle global privs (some software requires the db user have SUPER for triggers, etc)


  • @seeafish - Move pip setuptools upgrade out of pythonstack conditional and into main newrelic recipe
  • @seeafish - Forced utf-8 encoding on secure_password return value for rabbitmq password as it breaks newrelic


  • @martin - allow mysql monitoring template to converge on non-cloud boxes, actually test this by converging platformstack as part of stack_commons, in a separate test suite
  • @lmunro - changed rabbitmq logstash template to put all logs on a single line in a single message.
  • @martinb3 - Move newrelic tests from chefspec to serverspec, as upstream released a new version of the newrelic meetme agent cookbook, switching to LWRPs for some pieces of functionality we were testing in chefspec
  • @martinb3 - Removes the extraneous testing of distros where we did not check any differences
  • @martinb3 - Added some guards for recipes that did not like being converged with 'demo' set to true but with nginx enabled (the demo was only working w/ apache)



  • @seeafish - Add a fatal for mysql on ubuntu versions older than 14.04, as it will due to upstream
  • @seeafish - Remove mysql::client include as it's called by database::mysql anyway and causes compatibility issues


  • @seeafish - No change.


  • @martinb3 - Use node.deep_fetch, guard access to nested attrs


  • @martinb3 - Ensure a default value for custom monitoring array when not using platformstack.


  • @martinb3 - Removed platformstack dependencies and use attributes for configuring monitors.


  • @jujugrrr - Changed mysql logtash log path to match mysql multi


  • @jujugrrr - Changed rabbitmq monitoring port to 15672 and not the rabbitmq port (set by rabbitmq::mgmt_console)


  • @jujugrrr - Added mysql plugin support to newrelic


  • @seeafish - Added redis meetme functionality and cleaned up newrelic in general by removing refs to stackname and updating recipe inclusion checks.


  • @cybermerc - Added glusterfs


  • @jujugrrr - Fixed missing monitoring #26


  • @martinb3 - Migrated the logstash_commons calls to use attributes on elkstack instead. Added tests to verify the templates are pushed out successfully when converged with elkstack::agent in a wrapper recipe.


  • @jujugrrr - Added newrelic recipe


  • @jujugrrr - Removed systemd workaround as we don't support Centos7 anymore


Knife complained about uploading 0.0.7, but still uploaded, so I version bumped to be sure we had the latest/freshest:

$ knife cookbook site share stack_commons 'Other'
Generating metadata for stack_commons from /tmp/chef-stack_commons-build20141021-673-supw6x/stack_commons/metadata.rb
Making tarball stack_commons.tgz
ERROR: Error uploading cookbook stack_commons to the Opscode Cookbook Site: parse error: trailing garbage
                                   500 Internal Server Error If you ar
                     (right here) ------^
. Increase log verbosity (-VV) for more information.


  • @martinb3 - Added redis


  • [Julien Berard] - Added memcached


  • [Julien Berard] - Added mongodb_standalone

Check the Markdown Syntax Guide for help with Markdown.

The Github Flavored Markdown page describes the differences between markdown on github and standard markdown.

Foodcritic Metric

0.0.48 failed this metric

FC031: Cookbook without metadata file: /tmp/cook/519135181c42d82067f8acb2/stack_commons/metadata.rb:1
FC045: Consider setting cookbook name in metadata: /tmp/cook/519135181c42d82067f8acb2/stack_commons/metadata.rb:1