user and group for Nginx # user node[:nginx][:user] do comment "Nginx User" system true shell "/bin/false" end group node[:nginx][:user] do members ['ec2-user', node[:nginx][:user]] end # Create service for Nginx (/sbin/service nginx) # service "nginx" do supports :status => true, :restart => true, :reload => true action [ :enable, :start ] end # Create log directory # directory node[:nginx][:log_dir] do mode 0755 owner 'root' recursive true end # Create Nginx main configuration file # template "nginx.conf" do path "#{node[:nginx][:dir]}/nginx.conf" source "nginx.conf.erb" owner 'root' mode 0644 add .
infrastructure provisioning and management, maintained and supported by Opscode. You can use it to maintain a single server for your Wordpress blog, or a cluster of machines in production with equal ease. You can re-use knowledge and code from the larger #devops community and use the tooling provided by surrounding ecosystem.
Roles Nodes Data bags Full Text Search … Chef Server $ knife ssh name:data* "…" $ knife status $ knife search node … $ knife cookbook upload … $ chef-‐client
Ruby On Rails application on EC2 from a “zero state” ‣ 1 load balancer (HAproxy), 3 application servers (Thin+Nginx) ‣ 1 database node (PostgreSQL, Redis) ‣ 2-nodes elasticsearch cluster ‣ Install Ruby 1.9.3 via RVM ‣ Clone the application from (forked) GitHub repository ‣ init.d scripts and full configuration for every component ‣ Restore data from backup (database and search index) ‣ Monitor every part of the stack ‣ Under 30 minutes