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


play (4) Versions 1.0.1

Installs/Configures Play distribution binary as a service.

cookbook 'play', '= 1.0.1', :supermarket
cookbook 'play', '= 1.0.1'
knife supermarket install play
knife supermarket download play
Quality 100%

Play Cookbook

Cookbook Version
Build Status

Installs Play 2.2+ distribution artifact,
created by the dist or universal:packageZipTarball task,
and configures it as a service.

It is recommended that you include a application.conf.erb template file within the distribution artifact to configure
environment specific variables like application secret.

To include the .erb file in your distribution artifact, copy application.conf file and paste it as
application.conf.erb in the same directory. Then replace the environment specific values with variables.

For example, replace play.crypto.secret = "changeme" with play.crypto.secret = "<%= @secret %>" in
application.conf.erb file, then pass the variable and its value using conf_variables
attribute. The variable names in template must match variable names passed into conf_variables.

So if application.conf.erb contained:

play.crypto.secret = "<%= @secret %>"

And Play recipe was called with:

node.set['play']['servicename'] = 'servicename'
node.set['play']['source'] = ''
node.set['play']['conf_variables'] = { secret: 'abcdefghijk' }
include_recipe 'play'

This would then result in creating/replacing application.conf file with:

play.crypto.secret = "abcdefghijk"

Also Note

  • Leaving conf_variable empty will skip template processing and use configuration defined in conf_path
  • The conf_template path can also be external from distribution artifact


  • Java (must be installed outside this cookbook)
  • Chef 11+


  • Centos/RedHat
  • Ubuntu


  • ark


See play_test
cookbook for an example using play cookbook to install distribution artifacts as a service.


The attributes descriptions are for both resource and recipe e.g., servicename or node['play']['servicename'].

  • servicename - Service name to run as. Defaults to name of resource block.
  • source - URI to archive (zip, tar.gz, or tgz) or directory path to exploded archive.
  • checksum - The SHA-256 checksum of the file. Use to prevent resource from re-downloading a file. When local file matches the checksum, the chef-client will not download it.
  • project_name - Used to identify start script executable. Defaults to project name derived from standalone distribution filename, if not provided.
  • version - Version of application. Defaults to version derived from standalone distribution filename, if not provided. Not needed if source is a directory.
  • user - User to run service as. Default play.
  • args - Array of additional configuration arguments. Default [].
  • conf_variables - Hash of application configuration variables required by .erb template. Leave empty to not process conf_template and use application configuration defined in conf_path. Default {}.
  • conf_template - Path to configuration template. Path can be relative, or if the template file is outside dist path, absolute. If template file not found, no template processing will occur. Default conf/application.conf.erb.
  • conf_path - Path to application configuration file. Path can be relative, or if the config file is outside standalone distribution, absolute. Default conf/application.conf.
  • pid_dir - The pid directory. Default /var/run/play.


Examples below are using resource, but you can use the default recipe to do the same thing as well.

Install a standalone distribution as service from local file and generate application.conf

play 'servicename' do
  source 'file:///var/chef/cache/'
    secret: 'mysecret'
    langs: %w(en fr)
  action :install

The application configuration defined in conf_path will be created or replaced by template defined in conf_template.

Install exploded standalone distribution as service and don't generate application.conf

play 'sample_service' do
  source '/var/local/mysample'
  project_name 'sample'
  action :install

Since no conf_variables are passed, the application configuration defined in conf_path will be used.

ChefSpec Matchers

This cookbook includes custom ChefSpec matchers you can use to test your
own cookbooks.

Example Matcher Usage

expect(chef_run).to install_play('servicename').with(
  source: '',
  conf_variables: {
    secret: 'abcdefghijk'

Cookbook Matchers

  • install_play(name)

Getting Help


Please refer to CONTRIBUTING.


MIT - see the accompanying LICENSE file for

Dependent cookbooks

ark ~> 0.9

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Play Framework Changelog


  • Suppress FC021: Resource condition in provider may not behave as expected


  • Initial release

Foodcritic Metric

1.0.1 passed this metric