| title | category | layout |
|---|---|---|
Chef |
Devops |
2017/sheet |
In your server: {: .-setup}
$ sudo apt-get install curl$ curl -L https://omnitruck.chef.io/install.sh | sudo bash
Thank you for installing Chef!$ chef-solo -v
...
Chef: 14.5.33 wget http://github.com/chef-cookbooks/chef-repo/tarball/master -O - | tar xzf - --strip-components=1$ knife supermarket download mysql$ chef-solo -c solo.rb -j web.jsonexecute "tar --no-same-owner -zxf hi.tar.gz" do
cwd "/usr/local/src"
creates "/usr/local/src/node-v#{version}"
endbash "compile" do
cwd "/usr/local/src/node-v#{version}"
code %[
PATH=/usr/local/bin:$PATH
./configure
make
]
creates "/usr/local/src/node-v#{version}/node"
endremote_file "/usr/local/src/hi.tar.gz" do
source "http://..."
checksum "ab83be..."
mode 0644
action :create_if_missing
endruby_block "name" do
block { File.read ... }
not_if { File.exist?(...) }
endexecute "name" do
cwd "..."
environment({ "PATH" => "..." })
command "make install"
creates "..."
end creates "/usr/local/src/node-v#{version}/node"
not_if { File.exists?('...') }- Learn Chef Rally (learn.chef.io)
- install_from_source.rb recipe (github.com)