Skip to content

Commit

Permalink
use nginx upstream if there is a version specified
Browse files Browse the repository at this point in the history
  • Loading branch information
phunehehe committed Oct 22, 2014
1 parent 1cfb7b9 commit c99d44c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
7 changes: 0 additions & 7 deletions nginx/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,9 @@
when 'ubuntu'
default['nginx']['user'] = 'www-data'
default['nginx']['init_style'] = 'runit'
if node[:platform_version].to_f >= 12.04
default[:nginx][:types_hash_max_size] = 2048
end
default['nginx']['version'] = '1.1'
default['nginx']['repo_version'] = '1.1'
when 'redhat','centos','scientific','amazon','oracle','fedora'
default['nginx']['user'] = 'nginx'
default['nginx']['init_style'] = 'init'
default['nginx']['version'] = '1.0'
default['nginx']['repo_version'] = '1.0'
else
raise NotImplemented
end
10 changes: 5 additions & 5 deletions nginx/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
include_recipe 'yum::epel'
end

version = node[:nginx][:version]

# Use upstream repo if desired version doesn't match distro provided version:
if version != node[:nginx][:repo_version]
# Use upstream repo if a version is specified
if node[:nginx][:version]
case node[:platform_family]
when 'rhel'
include_recipe 'nginx::upstream_redhat'
Expand All @@ -21,7 +19,9 @@
# is already installed. :upgrade may cause some subtle problems but I guess
# it's OK for now.
action :upgrade
version node[:nginx][:version]
if node[:nginx][:version]
version node[:nginx][:version]
end
end

include_recipe 'nginx::commons'
Expand Down

0 comments on commit c99d44c

Please sign in to comment.