2. Chef is a systems integration
framework
Ruby
Write recipe that describes
a role
Integration through System or
API calls
Powerful search to discover info
about already existing
infrastructure
12. LWRP Continued
CBNAME/providers/mercurial.rb
action :clone do
bash "clone repository" do
action :nothing
user new_resource.user
group new_resource.group
environment ({'HOME' => Etc.getpwnam(new_resource.user).dir})
creates "#{new_resource.path}/.hg"
code "hg clone -r #{new_resource.revision} #{new_resource.repository}
#{new_resource.path}"
end.run_action :run
end
CBNAME_mercurial 'Some uniq name' do
Usage (in any cookbook that repository "https://some.repo.url/some/path"
depends on our CBNAME): action :clone
user 'jt'
group 'jt'
end
13. Links
Wiki (http://wiki.opscode.com/)
Community (http://community.opscode.com/)
●
Cookbooks
●
Blogposts
●
FAQ
●
Links
Source Code https://github.com/opscode/chef