Permalink
Browse files

added nginx.org's yum repo as an attribute option for RHEL-alike pack…

…age installs
  • Loading branch information...
1 parent f6059cd commit 7ef72a79b57cd44bed456e99a8d5dfdb17fd75b7 Nick Rycar committed with Chris Lundquist Dec 17, 2012
Showing with 55 additions and 1 deletion.
  1. +1 −0 attributes/default.rb
  2. +26 −0 attributes/yum.rb
  3. +5 −1 recipes/default.rb
  4. +23 −0 recipes/repo.rb
View
@@ -37,6 +37,7 @@
when "redhat","centos","scientific","amazon","oracle","fedora"
default['nginx']['user'] = "nginx"
default['nginx']['init_style'] = "init"
+ default['nginx']['repo_source'] = "epel"
else
default['nginx']['user'] = "www-data"
default['nginx']['init_style'] = "init"
View
@@ -0,0 +1,26 @@
+
+# Cookbook Name:: nginx
+# Recipe:: repo
+# Author:: Nick Rycar <nrycar@bluebox.net>
+#
+# Copyright 2008-2012, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+case node['platform']
+when "centos"
+ default['yum']['nginx']['url'] = "http://nginx.org/packages/centos/#{node['platform_version'].to_i}/$basearch/"
+else
+ default['yum']['nginx']['url'] = "http://nginx.org/packages/rhel/#{node['platform_version'].to_i}/$basearch/"
+end
+
View
@@ -26,7 +26,11 @@
when 'package'
case node['platform']
when 'redhat','centos','scientific','amazon','oracle'
- include_recipe 'yum::epel'
+ if node['nginx']['repo_source'] == 'epel'
+ include_recipe 'yum::epel'
+ else
+ include_recipe 'nginx::repo'
+ end
end
package node['nginx']['package_name']
service 'nginx' do
View
@@ -0,0 +1,23 @@
+# Cookbook Name:: nginx
+# Recipe:: repo
+# Author:: Nick Rycar <nrycar@bluebox.net>
+#
+# Copyright 2008-2012, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+yum_repository "nginx" do
+ description "Nginx.org Repository"
+ mirrorlist node['nginx']['yum']['url']
+end
+

0 comments on commit 7ef72a7

Please sign in to comment.