Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[COOK-2183] Install nginx package from nginx yum repo #72

Closed
wants to merge 3 commits into from

1 participant

@ChrisLundquist

http://tickets.opscode.com/browse/COOK-2183

Allow newer versions of nginx to be installed by using the nginx repo instead of epel.
This doesn't change the default behavior.

@ChrisLundquist

replaced by #77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 17, 2012
  1. added nginx.org's yum repo as an attribute option for RHEL-alike pack…

    Nick Rycar authored
    …age installs
  2. Helps if I get my attributes right

    Nick Rycar authored
  3. Also helps if I don't mix up url and mirrorlist.

    Nick Rycar authored
This page is out of date. Refresh to see the latest.
View
1  attributes/default.rb
@@ -36,6 +36,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['nginx']['yum']['url'] = "http://nginx.org/packages/centos/#{node['platform_version'].to_i}/$basearch/"
+else
+ default['nginx']['yum']['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 'nginx'
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"
+ url node['nginx']['yum']['url']
+end
+
Something went wrong with that request. Please try again.