[~/chef-hello/chef-repo/cookbooks]$ git clone https://github.com/opscode-cookbooks/homebrew.git
[~/chef-hello/chef-repo/cookbooks]$ ls
README.md hello homebrew
// localhost.json
{
"run_list" : [
"recipe[hello]",
"recipe[homebrew]"
]
}
# solo.rb
file_cache_path "/tmp/chef_solo"
cookbook_path ["/Users/atsushi/chef-hello/chef-repo/cookbooks"]
/cookbooks/hello/recipes/default.rb
#
# Cookbook Name:: hello
# Recipe:: default
#
# Copyright 2014, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
log "Hello Chef!"
package "zsh" do
action :install
end
%w{ffmpeg media-info imagemagick gv ghostscript}.each do |pkg|
package pkg do
action :install
end
end
[~/chef-hello/chef-repo]$ sudo chef-solo -c solo.rb -j ./localhost.json
Password:
Starting Chef Client, version 11.8.2
Compiling Cookbooks...
Converging 11 resources
Recipe: hello::default
* log[Hello Chef!] action write
* package[zsh] action install (up to date)
* package[ffmpeg] action install (up to date)
* package[media-info] action install (up to date)
* package[imagemagick] action install (up to date)
* package[gv] action install (up to date)
* package[ghostscript] action install (up to date)
Recipe: homebrew::default
* remote_file[/tmp/chef_solo/homebrew_go] action create (up to date)
* execute[/tmp/chef_solo/homebrew_go] action run (skipped due to not_if)
* package[git] action install (skipped due to not_if)
* execute[update homebrew from github] action run
- execute /usr/local/bin/brew update || true
Chef Client finished, 2 resources updated
[~/chef-hello/chef-repo]$ brew list
faac gdbm imagemagick lame libtool openssl sl wget yasm
ffmpeg ghostscript jbig2dec libpng little-cms2 pcre texi2html x264 zsh
freetype gv jpeg libtiff media-info pkg-config tree xvid