chef cookbookができるまで
YUKI "Piro" Hiroshi edited this page Apr 18, 2014
·
8 revisions
まず必要なパッケージをインストールする。 Ubuntu 12.04LTSの場合は、libgecode-devをあらかじめインストールしておかないとberksのインストールに失敗するようだった。
% sudo apt-get install libgecode-dev
berksをインストールする準備を整え、インストールする。
% md -p chef
% cd chef
% vi Gemfile
% cat Gemfile
# -*- ruby -*-
source "https://rubygems.org/"
gem "berkshelf"
% bundle install --path vendor/bundle
依存することになるcookbooksをインストールする準備を整え、インストールする。
% vi Berksfile
% cat Berksfile
# -*- ruby -*-
source "http://api.berkshelf.com/"
local_cookbooks_dir = "vendor/cookbooks"
cookbook "groonga", :git => "https://github.com/groonga/chef-cookbooks.git", :rel => "groonga"
cookbook "droonga", :git => "https://github.com/droonga/chef-cookbooks.git", :rel => "droonga"
% bundle exec berks vendor vendor/cookbooks
プロジェクト固有の情報を置いておくcookbookを作成する。
% knife cookbook create wikipedia-search -o site-cookbooks