Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'hw/feature/nginx.org-ubuntu-packages' i…

…nto repoadd
  • Loading branch information...
commit 4a023b3a4669b6e61461100f28d4ebd1a02e93b9 2 parents f90be39 + 8a7f215
Chris Lundquist authored
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
8 README.md
@@ -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
2  metadata.rb
@@ -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
View
19 recipes/nginx-org-package.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.