You are here: Home / presentations / Chef / Berkshelf

Berkshelf

by Alan Milligan last modified Sep 08, 2015 02:14 PM
Berkshelf - a librarian/manager for Chef

Client

Berksfile

#source "https://supermarket.chef.io"
source "https://dev1.last-bastion.net:26200"

cookbook 'chef_handler',        '1.1.4'
cookbook 'database',            '4.0.5'
cookbook 'erlang',              '1.1.2'
cookbook 'ntp',                 '1.4.0'
cookbook 'rabbitmq',            '2.4.2'
cookbook 'rsyslog',             '1.5.0'
cookbook 'selinux',             '0.5.6'

~/.berkshelf/config.json

{
  "ssl":{"verify": false, 
         "client_cert": "/etc/pki/tls/certs/lbn-alan.pem", 
         "client_key":"/etc/pki/tls/private/lbn-alan.key"}
}

Command line

$ berks --help
Commands:
  berks apply ENVIRONMENT     # Apply version locks from Berksfile.lock to a Chef environment
  berks contingent COOKBOOK   # List all cookbooks that depend on the given cookbook in your Berksfile
  berks cookbook NAME [PATH]  # Create a skeleton for a new cookbook
  berks help [COMMAND]        # Describe available commands or one specific command
  berks info [COOKBOOK]       # Display name, author, copyright, and dependency information about a cookbook
  berks init [PATH]           # Initialize Berkshelf in the given directory
  berks install               # Install the cookbooks specified in the Berksfile
  berks list                  # List cookbooks and their dependencies specified by your Berksfile
  berks outdated [COOKBOOKS]  # List dependencies that have new versions available that satisfy their constraints
  berks package [PATH]        # Vendor and archive the dependencies of a Berksfile
  berks search NAME           # Search the remote source for cookbooks matching the partial name
  berks shelf SUBCOMMAND      # Interact with the cookbook store
  berks show [COOKBOOK]       # Display the path to a cookbook on disk
  berks update [COOKBOOKS]    # Update the cookbooks (and dependencies) specified in the Berksfile
  berks upload [COOKBOOKS]    # Upload the cookbook specified in the Berksfile to the Chef Server
  berks vendor [PATH]         # Vendor the cookbooks specified by the Berksfile into a directory
  berks verify                # Perform a quick validation on the contents of your resolved cookbooks
  berks version               # Display version
  berks viz                   # Visualize the dependency graph

Options:
  -c, [--config=PATH]          # Path to Berkshelf configuration to use.
  -F, [--format=FORMAT]        # Output format to use.
                               # Default: human
  -q, [--quiet], [--no-quiet]  # Silence all informational output.
  -d, [--debug], [--no-debug]  # Output debug information

Server

 

Software Installation

rubygem-berkshelf-api

Configuration

lbnchef/berkserver

Testing

curl http://localhost:26200/universe