Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Fixed nginx cookbook along with CentOS update
Browse files Browse the repository at this point in the history
  • Loading branch information
kentaro committed Mar 20, 2013
1 parent 1a17412 commit 7161ce7
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 23 deletions.
3 changes: 2 additions & 1 deletion Cheffile
Expand Up @@ -3,7 +3,8 @@

site "http://community.opscode.com/api/v1"

cookbook "nginx"
cookbook "yum"
cookbook "build-essential"
cookbook "git"
cookbook "sudo"
cookbook "redis", git: "git://github.com/kentaro/chef-redis.git"
10 changes: 2 additions & 8 deletions Cheffile.lock
@@ -1,7 +1,6 @@
SITE
remote: http://community.opscode.com/api/v1
specs:
apt (1.9.0)
build-essential (1.3.4)
chef_handler (1.1.4)
dmg (1.1.0)
Expand All @@ -11,12 +10,6 @@ SITE
runit (~> 1.0)
windows (>= 0.0.0)
yum (>= 0.0.0)
nginx (1.4.0)
apt (>= 0.0.0)
build-essential (>= 0.0.0)
ohai (>= 1.1.4)
yum (>= 0.0.0)
ohai (1.1.8)
runit (1.1.0)
build-essential (>= 0.0.0)
sudo (2.0.4)
Expand All @@ -32,8 +25,9 @@ GIT
redis (0.0.4)

DEPENDENCIES
build-essential (>= 0)
git (>= 0)
nginx (>= 0)
redis (>= 0)
sudo (>= 0)
yum (>= 0)

1 change: 0 additions & 1 deletion roles/app.rb
Expand Up @@ -3,7 +3,6 @@
role[base]
recipe[sudo]
recipe[nginx]
recipe[site-nginx]
recipe[perl]
recipe[mysql::client]
recipe[daemontools]
Expand Down
1 change: 1 addition & 0 deletions roles/base.rb
@@ -1,6 +1,7 @@
name "base"
run_list %w(
recipe[base]
recipe[yum::yum]
recipe[build-essential]
)

Expand Down
1 change: 0 additions & 1 deletion site-cookbooks/base/recipes/user.rb
Expand Up @@ -2,7 +2,6 @@
action :create
password "$1$3uVcoLeR$lnfAW3PtHJBjk.Pknldad."
supports manage_home: true, non_unique: false
notifies :run, "directory[#{node.base.www_dir}]"
end

directory "/home/deployer/.ssh" do
Expand Down
2 changes: 1 addition & 1 deletion site-cookbooks/daemontools/recipes/install.rb
Expand Up @@ -9,7 +9,7 @@

cookbook_file "/etc/init/svscan.conf" do
action :create
notifies :run, "execute[svscan]"
notifies :reload, "execute[svscan]"
end

execute "svscan" do
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
Dir.glob("#{File.dirname(__FILE__)}/*.rb") do |file|
next if file =~ /default\.rb$/
file_name = file.scan(/([^\/]+)\.rb$/)[0].first
include_recipe "site-nginx::#{file_name}"
include_recipe "nginx::#{file_name}"
end
26 changes: 26 additions & 0 deletions site-cookbooks/nginx/recipes/install.rb
@@ -0,0 +1,26 @@
include_recipe "yum"

yum_key "nginx" do
url 'http://nginx.org/keys/nginx_signing.key'
action :add
end

yum_repository "nginx" do
repo_name "nginx"
url "http://nginx.org/packages/centos/#{node['platform_version'].to_i}/$basearch/"
end

package "nginx" do
action :install
end

template "/etc/nginx/conf.d/#{node.app.name}.conf" do
action :create
source "#{node.app.name}.conf.erb"
mode "0644"
notifies :reload, "service[nginx]"
end

service "nginx" do
action [:enable, :start]
end
Expand Up @@ -13,8 +13,8 @@ server {
listen <%= node.app.nginx.port %>;
server_name <%= node.app.domain %>;

access_log <%= node.nginx.log_dir %>/<%= node.app.name %>.access.log;
error_log <%= node.nginx.log_dir %>/<%= node.app.name %>.error.log;
access_log /var/log/nginx/<%= node.app.name %>.access.log;
error_log /var/log/nginx/<%= node.app.name %>.error.log;

location / {
proxy_pass http://<%= node.app.name %>/;
Expand Down
8 changes: 0 additions & 8 deletions site-cookbooks/site-nginx/recipes/conf.rb

This file was deleted.

0 comments on commit 7161ce7

Please sign in to comment.