Socket
Book a DemoInstallSign in
Socket

berkshelf-solo

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

berkshelf-solo

0.0.6
bundlerRubygems
Version published
Maintainers
1
Created
Source

Berkshelf Solo

berkshelf-solo is an experimental project that acts as an adapter between Berkshelf and chef-solo, it works by generating a chef-solo style layout and configuration files when executing the berks vendor command.

Dependencies

  • Ruby 1.9+
  • latest Berkshelf beta ( currently 3.0.0.beta9 )
  • Berksfile

Installation

with bundler just add this line to your Gemfile and then execute bundle install

gem 'berkshelf-solo'

else you can manually install it by running

gem install berkshelf-solo

Usage

Compile cookbooks and prepare chef-solo layout

add this line at the top of your Berksfile

require 'berkshelf-solo'

after loading berkshelf-solo you will able to specify recipes that you want to install, for example lets say we want to install mysql server and client

cookbook 'mysql', :recipes => ["client", "server"]

run the berks vendor command and specify the cookbooks output folder, in this example we save the cookbooks under the chef/cookbooks directory inside our current directory

berks vendor chef/cookbooks

after the command was successfully run, look for the chef-solo configuration files and folders layout under the chef directory, should look something like this

$ ls -lrth chef/
drwxr-xr-x   2  wheel    68B Aug 14 15:52 roles
drwxr-xr-x   2  wheel    68B Aug 14 15:52 environments
drwxr-xr-x   2  wheel    68B Aug 14 15:52 data_bags
drwxr-xr-x  11  wheel   374B Aug 14 16:21 cookbooks
-rw-r--r--   1  wheel   289B Aug 14 17:42 solo.rb
-rw-r--r--   1  wheel   313B Aug 14 17:42 solo.json

$ cat chef/solo.json
{
  "run_list": [
    "recipe[mysql::client]",
    "recipe[mysql::server]"
  ]
}

You can also specify cookbook attributes using the :attibutes option

cookbook 'mysql', :recipes => ["client", "server"], :attributes => {
  "server_root_password"   => "password",
  "server_debian_password" => "password",
  "server_repl_password"   => "password"
}

and after the berks verndor command was successfully run you should see them inside the solo.json

{
  "run_list": [
    "recipe[nginx::default]",
    "recipe[mysql::default]",
    "recipe[mysql::server]"
  ],
  "mysql": {
    "server_root_password": "password",
    "server_debian_password": "password",
    "server_repl_password": "password"
  }
}

Install cookbooks using chef-solo on your target machine

Now to actually install the recipes using chef-solo you will need to run this command on your target machine ( inside the main project folder, on Berksfile location )

chef-client -c `pwd`/chef/solo.rb -j `pwd`/chef/solo.json`

Warranty

This software is provided “as is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose.

FAQs

Package last updated on 27 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.