a configuration management tool from Opscode
what is configuration management?
in general, how a "system" should be configured and maintained
for Chef, how servers are configured
can be:
so...
what?
manage the infrastructure running your code the same way you manage your code
# Cookbook name:: your_app
# Recipe:: default
remote_file "/tmp/thing/tarball.tar.gz" do
action :create
source "http://example.com/your/tarball.tar.gz"
backup false
mode "0755"
end
execute "unarchive tarball for install" do
cwd '/tmp/thing'
command "tar zxf tarball.tar.gz -C #{node[:your_app][:dir]} && rm tarball.tar.gz"
only_if {::File.file?("/tmp/tarball.tar.gz")}
end
template "/etc/init.d/your_app" do
owner "root"
group "root"
source "your_app.erb"
mode "0755"
end
service "your_app" do
supports status: true, restart: true
action :enable
end
service "your_app" do
action :restart
end
/path/to/your_cookbook
├── README.md
├── attributes
├── definitions
├── files
│ └── default
├── libraries
├── metadata.rb
├── providers
├── recipes
│ └── default.rb
├── resources
└── templates
└── default
name "your_app_prod"
description "Deploys your_app in the production environment"
run_list(
"recipe[your_app_backend]",
"recipe[your_app_frontend]"
)
override_attributes(
:your_app_backend => { :port = 4242 },
:important_dependency => {
:some_setting => true,
:other_setting => "/path/to/cool/file"
}
)
got it?
either client-server or standalone
is that it?
there are a few other components
(data bags, environments, ...)
and best practices
but that's for another time