Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…age installs
  • Loading branch information...
commit 7ef72a79b57cd44bed456e99a8d5dfdb17fd75b7 1 parent f6059cd
Nick Rycar authored Chris Lundquist committed
View
1  attributes/default.rb
@@ -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
26 attributes/yum.rb
@@ -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
6 recipes/default.rb
@@ -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
23 recipes/repo.rb
@@ -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
+
Please sign in to comment.
Something went wrong with that request. Please try again.