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

RSS

chef-server (28) Versions 5.4.0

Installs and configures Chef Server 12

Policyfile
Berkshelf
Knife
cookbook 'chef-server', '= 5.4.0', :supermarket
cookbook 'chef-server', '= 5.4.0'
knife supermarket install chef-server
knife supermarket download chef-server
README
Dependencies
Changelog
Quality 100%

chef-server cookbook

Build Status Cookbook Version

This cookbook configures a system to be a standalone Chef Server. It will install the appropriate platform-specific chef-server Omnibus package from Package Cloud and perform the initial configuration.

It is not in the scope of this cookbook to handle more complex Chef Server topologies like 'tiered' or 'ha'. Nor is it in the scope of this cookbook to install and configure premium features or other add-ons. For clustered Chef Server deployments, see chef-server-cluster. For primitives for installing chef-server-core or other Chef Server add-ons, see chef-ingredient.

It is also not in the scope of this cookbook to handle older versions of Chef Server, such as 11 or 10. For Chef Server 11, see version 2.1.x of this cookbook on Supermarket, or the chef11 branch of this repository.

Requirements

Platforms

  • RHEL 6+
  • Ubuntu 14.04+

Chef

  • Chef 12.5+

Cookbooks

  • chef-ingredient >= 0.18

Attributes

The attributes used by this cookbook are under the chef-server name space.

Attribute Description Type Default
api_fqdn Fully qualified domain name that you want to use for accessing the Web UI and API. If set to nil or empty string (""), the IP address will be used as hostname. String node['fqdn']
configuration Configuration to pass down to the underlying server config file (i.e. /etc/chef-server/chef-server.rb). String ""
version Chef Server version to install. If nil, the latest version is installed String nil
addons Array of addon packages, or Hash if you want to lock addon version Example: {package1:'1.2.3'} (you need to add the addons recipe to the run list for the addons to be installed) Array []
accept_license A boolean value that specifies if license should be accepted if it is asked for during reconfigure. Boolean false

Previous versions of this cookbook had several other attributes used to control the version of the Chef Server package to install. This is deprecated.

Previous versions of this cookbook used configuration as a Hash. This is now deprecated and the configuration should be specified as a String. This must include newlines for each of the configuration items.

See https://docs.chef.io/config_rb_server.html for configuration options for Chef Server. For a complete list of product names for use in the add-ons attribute see https://github.com/chef/mixlib-install/blob/master/PRODUCT_MATRIX.md

Recipes

This section describes the recipes in the cookbook and how to use them in your environment.

default

This recipe:

  • Installs the appropriate platform-specific chef-server Omnibus package from our Package Cloud repository
  • Creates the initial /etc/chef-server/chef-server.rb file.
  • Performs initial system configuration via chef-server-ctl reconfigure.
  • Updates the /etc/hosts file with the api_fqdn if that FQDN cannot be resolved.

addons

Chef addons are premium features that can be installed on the Chef Server with the appropriate license. If there are under 25 nodes managed, or a paid subscription license, addons can be installed.

This recipe iterates through the node['chef-server']['addons'] attribute and installs and reconfigures all the packages listed.

Note: When multiple add-ons are installed, and one of them has version locked, either lock versions of all packages (best practice) or set version to nil
Example:

default['chef-server']['addons'] = {'chef-manage' => '2.5.0', reporting: nil}

Install Methods

Bootstrap Chef (server) with Chef (solo)

The easiest way to get a Chef Server up and running is to install chef-solo (via the chef-client Omnibus packages) and bootstrap the system using this cookbook:

# install chef-solo
curl -L https://www.chef.io/chef/install.sh | sudo bash
# create required bootstrap dirs/files
sudo mkdir -p /var/chef/cache /var/chef/cookbooks
# pull down this chef-server cookbook
wget -qO- https://supermarket.chef.io/cookbooks/chef-server/download | sudo tar xvzC /var/chef/cookbooks
# pull down dependency cookbooks
for dep in chef-ingredient yum-chef yum apt-chef apt packagecloud compat_resource
do
  wget -qO- https://supermarket.chef.io/cookbooks/${dep}/download | sudo tar xvzC /var/chef/cookbooks
done
# GO GO GO!!!
sudo chef-solo -o 'recipe[chef-server::default]'

Be sure to download and untar the chef-ingredient, yum-chef, yum, apt-chef, apt, compat_resource and packagecloud cookbooks. They're dependencies of this cookbook.

If you need more control over the final configuration of your Chef Server instance you can create a JSON attributes file and set underlying configuration via the node['chef-server']['configuration'] attribute. See the [attributes file](chef-server/attributes/default.rb).

Then pass this file to the initial chef-solo command:

chef-solo -j /tmp/dna.json

Configuring Chef Server

You can read all about Chef Server's configuration options on the Chef Documentation site.

Specify configuration using the node['chef-server']['configuration'] attribute as a string. Each configuration item should be separated by newlines. This string will be rendered exactly as written in the configuration file, /etc/opscode/chef-server.rb. For example, if we want to change the notification email, we could do this in a wrapper cookbook:

node.default['chef-server']['configuration'] = "notification_email 'chef-server@example.com'"

Or in a dna.json file:

{
  "chef-server": {
    "configuration": "notification_email 'chef-server@example.com'"
  }
}

Or, for multiple configuration settings, such as the notification email and the cache size for nginx, this uses a heredoc:

node.default['chef-server']['configuration'] = <<-EOS
notification_email 'chef-server@example.com'
nginx['cache_max_size'] = '3500m'
EOS

In a dna.json file, we need to insert a \n newline character.

{
  "chef-server": {
    "configuration": "notification_email 'chef-server@example.com'\nnginx['cache_max_size'] = '3500m'"
  }
}

Applying configuration changes

The chef-server-ctl command is the administrative interface to the Chef Server. It has its own documentation. Various administrative functions provided by chef-server-ctl are not in the scope of this cookbook. Special/customized needs should be managed in your own cookbook.

As this cookbook uses the chef-ingredient cookbook, its resources can be used to manage the Chef Server installation. The default recipe in this cookbook exposes chef_ingredient[chef-server] as a resource that can be sent a :reconfigure action from your own cookbooks. The omnibus_service resource can be used to manage the underlying services for the Chef Server. See the chef-ingredient cookbook for more information.

Chef Proprietary Product Licensings

If on convergence you are observing an error in the form of:

             ================================================================================
             Error executing action `run` on resource 'execute[chef-manage-reconfigure]'
             ================================================================================

             Mixlib::ShellOut::ShellCommandFailed
             ------------------------------------
             Expected process to exit with [0], but received '1'
             ---- Begin output of chef-manage-ctl reconfigure ----
             STDOUT: To use this software, you must agree to the terms of the software license agreement.
             Please view and accept the software license agreement, or pass --accept-license.
             STDERR:
             ---- End output of chef-manage-ctl reconfigure ----
             Ran chef-manage-ctl reconfigure returned 1

when using proprietary Chef products, you will need to make sure to accept the Chef Master License and Services Agreement (Chef MSLA).

Proprietary Chef products—such as Chef Compliance, Chef Delivery, Chef Analytics, Reporting, and the Chef Management Console—are governed by the Chef MLSA. The Chef MLSA must be accepted when installing or reconfiguring the product. Chef ingredient added the accept_license property to provide a way to automate this. This fix adds the attribute ['chef-server']['accept_license']. The default value is false. Individuals must explicitly change the value to true in their environment to accept the license. Make sure you set the node attribute ['chef-server']['accept_license'] = true to resolve this error.

License and Authors

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

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

chef-ingredient ~> 1.1

Contingent cookbooks

boilerplate Applicable Versions
chef Applicable Versions
chef-server-populator Applicable Versions
chef-server-webapp Applicable Versions
chef-server-with-letsencrypt Applicable Versions
chefsrv Applicable Versions
managed-chef-server Applicable Versions
managed_chef_server Applicable Versions

chef-server cookbook CHANGELOG

This file is used to list changes made in each version of the chef-server cookbook.

5.4.0 (2017-04-12)

  • Added the ability to specify the versions of each add-on to install so you can lock to specific versions

5.3.0 (2017-04-11)

  • Convert testing to kitchen-dokken with inspec with a test recipe that looks more like the wrapper cookbook a user would use
  • Convert lint / unit testing from Rake to Delivery local mode
  • Remove the table of product names in the readme, which weren't up to date. Link to mixlib-install instead since that list is updated
  • Update the license strings to be SPDX standard Apache-2.0

5.2.0 (2017-03-27)

  • Add compat_resource to the readme instructions
  • Pin chef-ingredient and require Chef 12.5+

5.1.0 (2016-09-16)

  • Testing updates
  • Require Chef 12.1 not 12.0

v5.0.1 (2016-04-28)

As of Chef management console 2.3.0 the Chef MLSA must be accepted when reconfiguring the product. Chef ingredient added the accept_license property to provide a way to automate this. This fix adds the attribute ['chef-server']['accept_license']. The default value is false. Individuals must explicitly change the value to true in their environment.

v5.0.0 (2016-04-13)

Breaking Changes:

This cookbook now requires chef-ingredient 0.18 or later. This switches the package source for chef-server packages to packages.chef.io, and also changes the names of the server add-ons as follows:

  • chef-ha -> ha
  • chef-sync -> sync
  • push-server -> push-jobs-server

v4.1.0 (2015-08-31)

  • #105: Move fqdn_resolves method to chef-ingredient cookbook.

v4.0.0 (2015-06-30)

Major version update, breaking changes ahead

  • 84: Add ability to set the package source with an attribute for local package installation
  • 90: Breaking Use chef-ingredient cookbook. The breaking change is that of the configuration file. Users who are modifying the configuration with the node['chef-server']['configuration'] attribute as a hash will need to convert it to a string. See the README for more detail.
  • 93: Add a topology attribute. Finally you can use this cookbook for non-standalone installs.

v3.1.1 (2015-04-09)

  • various cleanup
  • rubocop -a
  • adding .kitchen.cloud.yml
  • minor readability refactoring

v3.1.0 (2015-03-16)

  • Add a recipe and attribute to support installing addons. These are Chef premium features, see the README for more information about the addons recipe.

v3.0.1 (2015-03-02)

  • Issue #74, use :reconfigure action instead of notification so other configuration can happen after the Server is up within the same Chef run.

v3.0.0 (2015-02-24)

Major Version Update

Version 3.0.0 supports Chef Server 12. For background and rationale, see the mailing list post. Changes are from commit 0f2d123.

  • Remove the omnitruck API client library and related attributes
  • Use packagecloud repository for packages through the chef_server_ingredient resource
  • Remove the dev recipe
  • Remove the dependency on the git cookbook
  • Remove the Vagrantfile - we use test-kitchen now
  • Update the Berksfile accordingly
  • Add ServerSpec tests

Other changes

  • Fixes #46/COOK-4691, use IP address as hostname. This is only recommended for testing purposes.

v2.1.6 (2014-05-22)

  • COOK-4660 - Adds a OS version and image updates to the testing harness

v2.1.4 (2014-03-29)

  • Dropping dependency on git

v2.1.2 (2014-03-18)

  • [COOK-4386] - 'package_options' attribute added

v2.1.0 (2014-02-24)

  • Updating test harness, adding amazon support to omnitruck library
  • '[COOK-4176] - Ensure creation of :file_cache_path'
  • '[COOK-4178] - update Bento boxes used in chef-server cookbook'

v2.0.1

Documentation update to reflect Vagrant version dependency

v2.0.0

  • Complete re-write for Chef Server 11+. Chef Server is now installed
  • using "fat" Omnibus package.

v1.1.0

  • [COOK-1637] - Directory creation in chef-server should be recursive
  • [COOK-1638] - chef-server: Minor foodcritic fixups needed
  • [COOK-1643] - Chef Server Cookbook Missing Erlang in Metadata Depends
  • [COOK-1767] - use platform_family in chef-server cookbook

v1.0.0

  • [COOK-801] - add amazon linux
  • [COOK-886] - use bin path consistently
  • [COOK-1034] - expander bluepill doesn't have default value for node count

v0.99.12

  • [COOK-757] - compact all the views
  • [COOK-969] - server_name and server_aliases as configurable attributes on chef_server::nginx-proxy and chef_server::apache-proxy

Collaborator Number Metric
            

5.4.0 passed this metric

Contributing File Metric
            

5.4.0 passed this metric

Foodcritic Metric
            

5.4.0 passed this metric

License Metric
            

5.4.0 passed this metric

No Binaries Metric
            

5.4.0 passed this metric

Testing File Metric
            

5.4.0 passed this metric

Version Tag Metric
            

5.4.0 passed this metric