Hello World from OSS Silicon Valley


HowToUse/Chef/12.0


_ Prerequisite

_ Install&Setup

_ Install Chef

Step.1
# curl -L https://www.opscode.com/chef/install.sh | bash

_ Install knife-solo

Step.1
Install Ruby Dev.
# apt-get install ruby-dev
Step.2
install knife-solo
# gem install knife-solo

_ HowToUse

_ Hello World

Step.1
Create repository.
$ git clone git://github.com/opscode/chef-repo.git
Step.2
Configure knife. Choose default value for all parameters.
$ knife configure
Step.3
Create cookbook.
$ cd chef-repo
$ knife cookbook create hello -o cookbooks
Step.4
Edit cookbook.
$ vi cookbooks/hello/recipes/default.rb
log "Hello, World!"

package "zsh" do
  action :install
end
Step.5
Create json file
$ vi localhost.json
{
  "run_list" : [
    "recipe[hello]"
  ]
}
Step.6
Create cookbook setting file.
$ vi solo.rb
file_cache_path "/tmp/chef-solo"
cookbook_path ["/home/syatsuzuka/work/chef-repo/cookbooks"]
Step.7
Execute chef-solo.
$ sudo chef-solo -c solo.rb -j ./localhost.json

_ knife-solo

Step.1

_ Author

S.Yatsuzuka