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-client (130) Versions 0.99.1

Manages client.rb configuration and chef-client service

Policyfile
Berkshelf
Knife
cookbook 'chef-client', '= 0.99.1', :supermarket
cookbook 'chef-client', '= 0.99.1'
knife supermarket install chef-client
knife supermarket download chef-client
README
Dependencies
Quality -%

DESCRIPTION

This cookbook is used to configure a system as a Chef Client.

REQUIREMENTS

Chef 0.9.12 or later is required.

Supported Platforms

The following platforms are supported by this cookbook, meaning that the recipes run on these platforms without error.

  • Debian
  • Ubuntu
  • Red Hat
  • CentOS
  • Fedora
  • ArchLinux
  • FreeBSD
  • Mac OS X

Other Cookbooks

Other cookbooks can be used with this cookbook but they are not explicitly required. The default settings in this cookbook do not require their use. The other cookbooks (on cookbooks.opsocde.com) are:

  • bluepill
  • daemontools
  • runit

See USAGE below.

ATTRIBUTES

  • node["chef_client"]["interval"] - Sets Chef::Config[:interval] via command-line option for number of seconds between chef-client daemon runs. Default 1800.
  • node["chef_client"]["splay"] - Sets Chef::Config[:splay] via command-line option for a random amount of seconds to add to interval. Default 20.
  • node["chef_client"]["log_dir"] - Sets directory used in Chef::Config[:log_location] via command-line option to a location where chef-client should log output. Default "/var/log/chef".
  • node["chef_client"]["server_url"] - Sets Chef::Config[:chef_server_url] in the config file to the Chef Server URI. Default "http://localhost:4000". See USAGE.
  • node["chef_client"]["validation_client_name"] - Sets Chef::Config[:validation_client_name] in the config file to the name of the validation client. Default "chef-validator". See USAGE.
  • node["chef_client"]["init_style"] - Sets up the client service based on the style of init system to use. Default is based on platform and falls back to "none". See USAGE.
  • node["chef_client"]["run_path"] - Directory location where chef-client should write the PID file. Default based on platform, falls back to "/var/run".
  • node["chef_client"]["cache_path"] - Directory location for Chef::Config[:file_cache_path] where chef-client will cache various files. Default is based on platform, falls back to "/var/chef/cache".
  • node["chef_client"]["backup_path"] - Directory location for Chef::Config[:file_backup_path] where chef-client will backup templates and cookbook files. Default is based on platform, falls back to "/var/chef/backup".

RECIPES

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

config

Sets up the /etc/chef/client.rb config file from a template and reloads the configuration for the current chef-client run.

service

Use this recipe on systems that should have a chef-client daemon running, such as when Knife bootstrap was used to install Chef on a new system.

This recipe sets up the chef-client service depending on the init_style attribute (see above). The following init styles are supported:

  • init - uses the init script included in the chef gem, supported on debian and redhat family distributions.
  • upstart - uses the upstart job included in the chef gem, supported on ubuntu.
  • arch - uses the init script included in this cookbook for ArchLinux, supported on arch.
  • runit - sets up the service under runit, supported on ubuntu, debian and gentoo.
  • bluepill - sets up the service under bluepill. As bluepill is a pure ruby process monitor, this should work on any platform.
  • daemontools -sets up the service under daemontools, supported on debian, ubuntu and arch
  • bsd - prints a message about how to update BSD systems to enable the chef-client service, supported on Free/OpenBSD and OSX.

default

Includes the chef-client::service recipe by default.

delete_validation

Use this recipe to delete the validation certificate (default /etc/chef/validation.pem) when using a chef-client after the client has been validated and authorized to connect to the server.

Beware if using this on your Chef Server. First copy the validation.pem certificate file to another location, such as your knife configuration directory (~/.chef) or Chef Repository.

USAGE

Create a base role that will represent the base configuration for any system that includes managing aspects of the chef-client. Add recipes to the run list of the role, customize the attributes, and apply the role to nodes. For example, the following role (Ruby DSL) will set the init style to init, delete the validation certificate (as the client would already be authenticated) and set up the chef-client as a service using the init style.

name "base"
description "Base role applied to all nodes"
override_attributes(
  "chef_client" => {
    "init_style" => "init"
  }
)
run_list(
  "recipe[chef-client::delete_validation]",
  "recipe[chef-client::config]",
  "recipe[chef-client]"
)

The chef-client::config recipe is only required with init style init (default setting for the attribute on debian/redhat family platforms, because the init script doesn't include the pid_file option which is set in the config.

The default Chef Server will be http://localhost:4000 which is the Chef::Config[:chef_server_url] default value. To use the config recipe with the Opscode Platform, for example, add the following to the override_attributes

override_attributes(
  "chef_client" => {
    "server_url" => "https://api.opscode.com/organizations/ORGNAME",
    "validation_client_name" => "ORGNAME-validator"
  }
)

Where ORGNAME is your Opscode Platform organization name. Be sure to add these attributes to the role if modifying per the section below.

Alternate Init Styles

The alternate init styles available are:

  • runit
  • bluepill
  • daemontools

For usage, see below.

Runit

To use runit, download the cookbook from the cookbook site.

knife cookbook site vendor runit

Change the init_style to runit in the base role and add the runit recipe to the role's run list:

name "base"
description "Base role applied to all nodes"
override_attributes(
  "chef_client" => {
    "init_style" => "runit"
  }
)
run_list(
  "recipe[chef-client::delete_validation]",
  "recipe[runit]",
  "recipe[chef-client]"
)

The chef-client recipe will create the chef-client service configured with runit. The runit run script will be located in /etc/sv/chef-client/run. The output log will be in the runit service directory, /etc/sv/chef-client/log/main/current.

Bluepill

To use bluepill, download the cookbook from the cookbook site.

knife cookbook site vendor bluepill

Change the init_style to runit in the base role and add the bluepill recipe to the role's run list:

name "base"
description "Base role applied to all nodes"
override_attributes(
  "chef_client" => {
    "init_style" => "bluepill"
  }
)
run_list(
  "recipe[chef-client::delete_validation]",
  "recipe[bluepill]",
  "recipe[chef-client]"
)

The chef-client recipe will create the chef-client service configured with bluepill. The bluepill "pill" will be located in /etc/bluepill/chef-client.pill. The output log will be to client.log file in the node["chef_client"]["log_dir"] location, /var/log/chef/client by default.

Daemontools

To use daemontools, download the cookbook from the cookbook site.

knife cookbook site vendor daemontools

Change the init_style to runit in the base role and add the daemontools recipe to the role's run list:

name "base"
description "Base role applied to all nodes"
override_attributes(
  "chef_client" => {
    "init_style" => "daemontools"
  }
)
run_list(
  "recipe[chef-client::delete_validation]",
  "recipe[daemontools]",
  "recipe[chef-client]"
)

The chef-client recipe will create the chef-cilent service configured under daemontools. It uses the same sv run scripts as the runit recipe. The run script will be located in /etc/sv/chef-client/run. The output log will be in the daemontools service directory, /etc/sv/chef-client/log/main/current.

TEMPLATES

chef-client.pill.erb

Bluepill configuration for the chef-client service.

client.rb.erb

Configuration for the client, lands in /etc/chef/client.rb.

sv-chef-client-*run.erb

Runit and Daemontools run script for chef-client service and logs.

Logs will be located in the node["chef_client"]["log_dir"].

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

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

base_image Applicable Versions
base_install Applicable Versions
chef Applicable Versions
chef-client_syslog Applicable Versions
chef-reporting Applicable Versions
cinc-client Applicable Versions
common_linux Applicable Versions
formatron_common Applicable Versions
il-base Applicable Versions
my_cookbook Applicable Versions
nmdbase Applicable Versions
paramount Applicable Versions
platformstack Applicable Versions
rundeck-bridge Applicable Versions
sanitize Applicable Versions
server-base Applicable Versions

No quality metric results found