Permalink
Browse files

initial stab at installing nginx.org ubuntu packages

  • Loading branch information...
dje committed Jan 11, 2013
1 parent f6059cd commit 8a7f21572372b0b311f89174d4401aa813bc4f86
Showing with 27 additions and 2 deletions.
  1. +7 −1 README.md
  2. +1 −1 metadata.rb
  3. +19 −0 recipes/nginx-org-package.rb
View
@@ -23,6 +23,9 @@ be controlled by an attribute, so it may not be a common "default."
On RHEL family distros, the "yum" cookbook is required for "`recipe[yum::epel]`".
+On Ubuntu, when using Nginx.org's stable package, "`recipe[apt]`"
+is required.
+
Platform
--------
@@ -229,10 +232,13 @@ These attributes are used in the `nginx::http_echo_module` recipe.
Recipes
=======
-This cookbook provides two main recipes for installing Nginx.
+This cookbook provides three main recipes for installing Nginx.
* default.rb: *Use this recipe* if you have a native package for
Nginx.
+* nginx-org-package.rb: The developer of Nginx also maintain
+ [stable packages](http://nginx.org/en/download.html) for several
+ platforms. (Only Ubuntu support implemented presently)
* source.rb: *Use this recipe* if you do not have a native package for
Nginx, or if you want to install a newer version than is available,
or if you have custom module compilation needs.
View
@@ -18,7 +18,7 @@
depends 'ohai', '>= 1.1.4'
-%w{ bluepill yum }.each do |cb|
+%w{ bluepill yum apt }.each do |cb|
recommends cb
end
@@ -0,0 +1,19 @@
+include_recipe 'apt'
+
+case node['platform']
+when 'ubuntu'
+ apt_repository 'nginx.org' do
+ uri 'http://nginx.org/packages/ubuntu'
+ distribution node['lsb']['codename']
+ components ['nginx']
+ key 'http://nginx.org/keys/nginx_signing.key'
+ end
+
+ include_recipe 'nginx'
+
+ file '/etc/nginx/conf.d/default.conf' do
+ action :delete
+ end
+else
+ Chef::Log.error "Nginx.org package not implmented for platform: #{node['platform']}"
+end

0 comments on commit 8a7f215

Please sign in to comment.