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


sonarqube_server (2) Versions 0.1.0

Installs/Configures sonarqube_server

cookbook 'sonarqube_server', '= 0.1.0', :supermarket
cookbook 'sonarqube_server', '= 0.1.0'
knife supermarket install sonarqube_server
knife supermarket download sonarqube_server
Quality 0%


Install and configure SonarQube code analysis tool.

SonarQube requires Java but this cookbook does not install Java. If you do not
already have a Java cookbook, look at the
Java cookbook.

Currently only supports Red Hat-based distributions. Support for Debian-based
distributions is in the plans.


To install a stock Sonarqube server, create a recipe such as the following:

include_recipe 'java'

# Install the latest version of SonarQube with default properties
# including H2 database (not recommended for production installation)
sonarqube_server 'sonar' do
  notifies :restart, 'service[sonar]'

# Create a Sonar service. This is required if you want Sonar to start.
service 'sonar' do
  action [:enable, :start]
  supports status: true, restart: true, reload: true

The following snippet shows how to customize the installation including
configuration properties. The properties attribute under config_options
should be created as a Ruby hash where the nested hashes represent the dot-notated
property key. For example, the property key for database username is
sonar.jdbc.username and is represented in the Ruby hash as seen below. Any
configuration property Sonar supports will work.

sonarqube_server 'sonar' do
  baseurl ''
  version '5.1.2-1'
  config_options do
      'sonar' => {
        'jdbc' => {
          'username' => 'sonar_custom',
          'password' => 'super_secret',
          'url'      => 'jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance'
        'web' => {
          'javaOpts' => '-Xmx1024m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -server'
  notifies :restart, 'service[sonar]'


Generating Documentation

DO NOT EDIT THIS file directly. This file is generated using knife-cookbook-doc plugin.
Install this plugin with gem install knife-cookbook-doc.
Documentation is compiled from the following sources:

  1. Derived for attributes/recipes either by scanning the source code or by explicit declaration in metadata.rb
  2. Markdown files in the doc/ directory (overview is always the first to be compiled)

To edit this README:

  1. Change relevant sections within the markdown files in the doc/ directory
  2. Edit metadata.rb or use inline annotated comments within the source code. For more info on inline comments click here
  3. Generate new README using knife-cookbook-doc plugin and push changes to remote branch. For more info on using the knife-cookbook-doc plugin click here.


Code Style

To run style tests (Rubocop and Foodcritic):
rake style

If you want to run either Rubocop or Foodcritic separately, specify the style
test type (Rubocop = ruby, Foodcritic = chef)
rake style:chef
rake style:ruby

RSpec tests

Run RSpec unit tests
rake spec

Test Kitchen

Run Test Kitchen tests (these tests take quite a bit of time)
rake integration:vagrant

If the cookbook has tests that run in EC2
rake integration:cloud


If you choose to fork this cookbook here are some good tips to keep things in

  1. Fork the cookbook before cloning.
  2. Clone the forked repo, not the original.
  3. Once the fork is cloned, go to the repo directory and add an upstream remote git remote add upstream

Now you can pull upstream changes (things merged into the main cookbook repo).
Note that you will also need to push to your fork's master to keep it updated.
The alias below will help you. After adding the alias you will simply be able to
run git-reup and it will pull the upstream changes and push them to
your fork. Then checkout a branch and work as normal.

Add the following alias in ~/.bash_profile.
alias git-reup='git checkout master && git pull upstream master && git push origin master'



No platforms defined


  • poise (~> 2.0)
  • java (~> 1.31)
  • yum (~> 3.6)


No attributes defined


No recipes defined

License and Maintainer

Maintainer:: Apache 2 (

License:: all_rights

Dependent cookbooks

poise ~> 2.0
java ~> 1.31
yum ~> 3.6

Contingent cookbooks

There are no cookbooks that are contingent upon this one.



  • Initial release

Foodcritic Metric

0.1.0 failed this metric

FC031: Cookbook without metadata file: /tmp/cook/e7263ae86fc6ff3677b6f997/sonarqube_server/metadata.rb:1
FC045: Consider setting cookbook name in metadata: /tmp/cook/e7263ae86fc6ff3677b6f997/sonarqube_server/metadata.rb:1