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

berkshelf-api (4) Versions 1.1.0

Installs a Berkshelf API server

Policyfile
Berkshelf
Knife
cookbook 'berkshelf-api', '= 1.1.0', :supermarket
cookbook 'berkshelf-api', '= 1.1.0'
knife supermarket install berkshelf-api
knife supermarket download berkshelf-api
README
Dependencies
Quality 0%

berkshelf-api

Build Status

Quick Start

Apply the following role to your server (making sure both cookbooks are available):

{
  "name": "berkshelf-api",
  "description": "",
  "json_class": "Chef::Role",
  "default_attributes": {
  },
  "override_attributes": {
  },
  "chef_type": "role",
  "run_list": [
      "recipe[nginx]",
      "recipe[berkshelf-api]",
  ],
  "env_run_lists": {
  }
}

Attributes

  • node['berkshelf-api']['path'] – The directory to hold the configuration and cache. (default: /etc/berkshelf)
  • node['berkshelf-api']['version'] – Version or git reference to install. (default: master)
  • node['berkshelf-api']['port'] – Port to listen on. (default: 26200)
  • node['berkshelf-api']['log_path'] – Directory for runit logs (default: ./main, under /etc/sv/berkshelf-api)
  • node['berkshelf-api']['log_verbosity'] – Log verbosity flag, one of '', '-v', '-d', '-q'. (default: '')
  • node['berkshelf-api']['user'] – User to run as. (default: berkshelf)
  • node['berkshelf-api']['group'] – Group to run as. (default: berkshelf)
  • node['berkshelf-api']['install_path'] – The directory to clone into if installing from git. (default: /opt/berkshelf)
  • node['berkshelf-api']['git_repository'] – URI to clone from if installing from git. (default: https://github.com/berkshelf/berkshelf-api.git)
  • node['berkshelf-api']['config'] – A hash of configuration data to be added to config.json. (default: {})
  • node['berkshelf-api']['opscode_url'] – URL to use for the default Community Site endpoint. (default: https://community.opscode.com/api/v1)
  • node['berkshelf-api']['proxy']['enabled'] – Install an HTTP proxy. (default: if the apache2 or nginx recipe is in the run list)
  • node['berkshelf-api']['proxy']['listen_ports'] – HTTP ports for the proxy. (default: [80])
  • node['berkshelf-api']['proxy']['hostname'] – Server name for the proxy. (default: node['fqdn'])
  • node['berkshelf-api']['proxy']['ssl_enabled'] – Configure HTTPS support. (default: false)
  • node['berkshelf-api']['proxy']['ssl_redirect_http'] – Redirect from http: to https: if SSL is enabled. (default: true)
  • node['berkshelf-api']['proxy']['ssl_listen_ports'] – HTTPS ports for the proxy. (default: [443])
  • node['berkshelf-api']['proxy']['ssl_path'] – Base path for SSL-related files. (default: /etc/berkshelf/ssl)
  • node['berkshelf-api']['proxy']['ssl_cert_path'] – Path to the SSL certificate. (default: /etc/berkshelf/ssl/berkshelf-api.pem)
  • node['berkshelf-api']['proxy']['ssl_key_path'] – Path to the SSL private key. (default: /etc/berkshelf/ssl/berkshelf-api.key)
  • node['berkshelf-api']['proxy']['provider'] – Proxy provider to use. One of: nginx, apache. (default: auto-detect based on run list)

Resources

berkshelf_api

The berkshelf_api resource defines a berkshelf-api server installation.

berkshelf_api '/etc/berks' do
  version '1.1.0'
  config do
    endpoints [{type: 'opscode'}]
  end
end

All resource attributes have the same meaning as the node attributes above and
default to the node attribute if not specified.

  • path – The directory to hold the configuration and cache. (name_attribute)
  • version – Version or git reference to install. (default: node['berkshelf-api']['version'])
  • port – Port to listen on. (default: node['berkshelf-api']['port'])
  • user – User to run as. (default: node['berkshelf-api']['user'])
  • group – Group to run as. (default: node['berkshelf-api']['group'])
  • install_path – The directory to clone into if installing from git. (default: node['berkshelf-api']['install_path'])
  • git_repository – URI to clone from if installing from git. (default: node['berkshelf-api']['git_repository'] if version is a git reference)
  • config – A hash or block of configuration data to be added to config.json.
  • log_path - Directory to write the runit service logs, relative to /etc/sv/berkshelf-api . (default: node['berkshelf-api']['log_path'])
  • log_verbosity - Which flag, if any, to pass to berks-api to control log verbosity; one of '', '-d','-v', or '-q'. (default: node['berkshelf-api']['log_verbosity'])

berkshelf_api_opscode_endpoint

The berkshelf_api_opscode_endpoint defines a community site endpoint for a
berkshelf_api resource.

berkshelf_api_opscode_endpoint 'https://community.opscode.com/api/v1'

It can also be used via the shorter, nested syntax:

berkshelf_api '/etc/berks' do
  opscode_endpoint # Defaults to node['berkshelf-api']['opscode_url'] if no URL is given
  opscode_endpoint 'http://example.com/cookbooks'
end
  • url – URL for the community site. (name_attribute)

berkshelf_api_chef_server_endpoint

The berkshelf_api_chef_server_endpoint defines a chef server endpoint for a
berkshelf_api resource.

berkshelf_api_chef_server_endpoint 'https://api.opscode.com/organizations/example' do
  client_name 'berks'
  client_key <<EOH
-----BEGIN RSA PRIVATE KEY-----
[...]
-----END RSA PRIVATE KEY-----
EOH
end

It can also be used via the shorter, nested syntax:

berkshelf_api '/etc/berks' do
  chef_server_endpoint 'https://api.opscode.com/organizations/example', 'berks', '[...]'
  chef_server_endpoint 'https://api.opscode.com/organizations/example' do
    client_name 'berks'
    client_key <<EOH
-----BEGIN RSA PRIVATE KEY-----
[...]
-----END RSA PRIVATE KEY-----
EOH
  end
end
  • url – URL for the chef server. (name_attribute)
  • client_name – Chef API client username. (required)
  • client_key – Chef API client private key. (required)

berkshelf_api_auto_chef_server_endpoint

The berkshelf_api_chef_server_endpoint defines a chef server endpoint for a
berkshelf_api resource that uses the same configuration as the active chef-client.

berkshelf_api_auto_chef_server_endpoint ''

It can also be used via the shorter, nested syntax:

berkshelf_api '/etc/berks' do
  auto_chef_server_endpoint
end

berkshelf_api_github_endpoint

The berkshelf_api_github_endpoint defines a Github endpoint for a
berkshelf_api resource.

berkshelf_api_github_endpoint 'myorg' do
  api_token '[...]'
end

It can also be used via the shorter, nested syntax:

berkshelf_api '/etc/berks' do
  github_endpoint 'myorg', '[...]'
  github_endpoint 'myorg' do
    api_token '[...]'
  end
end
  • organization – Github organization to scan. (name_attribute)
  • api_token – Github API token. (required)

Dependent cookbooks

build-essential >= 0.0.0
git >= 0.0.0
poise >= 0.0.0
poise-ruby >= 0.0.0
runit >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Foodcritic Metric
            

1.1.0 failed this metric

FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/f0e8c9d39fb8b152d2068fe6/berkshelf-api/templates/default/proxy_apache.conf.erb:3
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/f0e8c9d39fb8b152d2068fe6/berkshelf-api/templates/default/proxy_nginx.conf.erb:3
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/f0e8c9d39fb8b152d2068fe6/berkshelf-api/templates/default/proxy_nginx.conf.erb:69
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/f0e8c9d39fb8b152d2068fe6/berkshelf-api/templates/default/proxy_nginx.conf.erb:70
FC007: Ensure recipe dependencies are reflected in cookbook metadata: /tmp/cook/f0e8c9d39fb8b152d2068fe6/berkshelf-api/libraries/berkshelf_api_proxy.rb:159
FC007: Ensure recipe dependencies are reflected in cookbook metadata: /tmp/cook/f0e8c9d39fb8b152d2068fe6/berkshelf-api/libraries/berkshelf_api_proxy.rb:183
FC007: Ensure recipe dependencies are reflected in cookbook metadata: /tmp/cook/f0e8c9d39fb8b152d2068fe6/berkshelf-api/libraries/berkshelf_api_proxy.rb:184
FC007: Ensure recipe dependencies are reflected in cookbook metadata: /tmp/cook/f0e8c9d39fb8b152d2068fe6/berkshelf-api/libraries/berkshelf_api_proxy.rb:185
FC023: Prefer conditional attributes: /tmp/cook/f0e8c9d39fb8b152d2068fe6/berkshelf-api/libraries/berkshelf_api.rb:226
FC023: Prefer conditional attributes: /tmp/cook/f0e8c9d39fb8b152d2068fe6/berkshelf-api/libraries/berkshelf_api_proxy.rb:107
FC023: Prefer conditional attributes: /tmp/cook/f0e8c9d39fb8b152d2068fe6/berkshelf-api/libraries/berkshelf_api_proxy.rb:117
FC023: Prefer conditional attributes: /tmp/cook/f0e8c9d39fb8b152d2068fe6/berkshelf-api/libraries/berkshelf_api_proxy.rb:128