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


dropwizard (7) Versions 1.0.4

Custom resource for managing dropwizard applications

cookbook 'dropwizard', '= 1.0.4', :supermarket
cookbook 'dropwizard', '= 1.0.4'
knife supermarket install dropwizard
knife supermarket download dropwizard
Quality 43%

dropwizard cookbook

Exposes an LWRP for managing dropwizard applications.

Build Status


Supported Platforms

Creates an upstart init script, so this will work for any OS that supports it, including Ubuntu and CentOS. Will look at expanding to more platforms later.

Resources and Provider Usage

dropwizard resource


attribute required default description
name true Name of the application. Implied from resource name.
path false /opt/[name] Path for the application. Will default into /opt with the application name.
user true System user for running the application.
group false System group for running the application.
jar_file false /opt/[name]/[name].jar Path to your dropwizard application's fat JAR file. It will look into a default path if this isn't set. The default path can be a symlink to your real JAR file, but will depend on your release process.
java_bin false Output of which java or /usr/bin/java Specific java command for running the application. Should be set as #{node['java']['home']}/bin/java when using the java cookbook.
jvm_options false JVM options with which to start the dropwizard application. Although there are none set by default, it's highly recommended that you at least set the -Xms and -Xmx parameters here for defining the Java heap size.
arguments false server Arguments to pass after the jar file inclusion. See Running Your Service in the dropwizard docs for more info. This is where you'd also want to include your YAML config file (don't forget to add server!).
pid_path false /var/run Directory in which the PID file should be created. By default, creates the file as: /var/run/[name].pid
init_script_source false dropwizard-init.conf.erb Source template file for which init script to use. Will using this cookbook's template file by default, but can be replaced with your own.
init_script_cookbook false dropwizard If you change the init_script_source attribute, you'll also need to override this one with the name of your own cookbook.

:install action

Creates application user, directories, init scripts, and service for the dropwizard application. Check out the Examples section of this README for more information.

:delete action

Removes the directories, init scripts and service for the dropwizard application. Will leave the user intact, though.

:disable action

Disables and stops the dropwizard application service, but makes no other changes


Check out this project's test/cookbooks/dw_test directory for an example recipe.

1) Most basic example:

dropwizard 'application_name' do
  user 'app_user'

2) Including a dropwizard config and a few other options:

dropwizard node['your_app']['name'] do
  user 'app_user'
  java_bin "#{node['java']['home']}/bin/java"
  jvm_options '-Xms1g -Xmx1g'
  arguments "server #{node['your_app']['config']}"

template node['your_app']['config'] do
  source 'your_app-config.yml.erb'
  mode 0644
  owner node['your_app']['user']
  group node['your_app']['group']

  subscribes :create, "dropwizard[#{node['your_app']['name']}]", :delayed

Running Tests

Running basic knife tests, foodcritic, chefspec, and rubocop can be done with:

$ bundle install
$ rake

test-kitchen is also used, and can be run with:

$ kitchen test

To use test-kitchen, make sure you go through the Getting started instructions first if you haven't done so already.


Copyright 2013 Greg Lu

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

apt >= 0.0.0
java >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric

1.0.4 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric

1.0.4 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Foodcritic Metric

1.0.4 failed this metric

FC059: LWRP provider does not declare use_inline_resources: dropwizard/providers/default.rb:1
FC064: Ensure issues_url is set in metadata: dropwizard/metadata.rb:1
FC065: Ensure source_url is set in metadata: dropwizard/metadata.rb:1
FC066: Ensure chef_version is set in metadata: dropwizard/metadata.rb:1
FC069: Ensure standardized license defined in metadata: dropwizard/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: dropwizard/resources/default.rb:1
Run with Foodcritic Version 12.0.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric

1.0.4 passed this metric

No Binaries Metric

1.0.4 passed this metric

Testing File Metric

1.0.4 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

1.0.4 passed this metric