package "nginx" service "nginx" do supports :status => true, :restart => true, :reload => true action :enable end directory node[:nginx][:log_dir] do mode 0755 owner node[:nginx][:user] action :create end %w{nxensite nxdissite}.each do |nxscript| template "/usr/sbin/#{nxscript}" do source "#{nxscript}.erb" mode 0755 owner "root" group "root" end end template "nginx.conf" do path "#{node[:nginx][:dir]}/nginx.conf" source "nginx.conf.erb" owner "root" group "root" mode 0644 notifies :reload, "service[nginx]" end template "#{node[:nginx][:dir]}/sites-available/default" do source "default.conf.erb" owner "root" group "root" mode 0644 notifies :reload, "service[nginx]" end service "nginx" do action :start end monitrc "nginx"