diff --git a/attributes/source.rb b/attributes/source.rb index bcbd03894..c93c4f76e 100644 --- a/attributes/source.rb +++ b/attributes/source.rb @@ -31,7 +31,8 @@ ] default['nginx']['configure_flags'] = Array.new -default['nginx']['source']['url'] = "http://nginx.org/download/nginx-#{node['nginx']['version']}.tar.gz" +default['nginx']['source']['version'] = node['nginx']['version'] +default['nginx']['source']['url'] = "http://nginx.org/download/nginx-#{node['nginx']['source']['version']}.tar.gz" default['nginx']['source']['checksum'] = "0510af71adac4b90484ac8caf3b8bd519a0f7126250c2799554d7a751a2db388" default['nginx']['source']['modules'] = [ "http_ssl_module", diff --git a/recipes/source.rb b/recipes/source.rb index 523442511..25f548e5c 100644 --- a/recipes/source.rb +++ b/recipes/source.rb @@ -26,7 +26,7 @@ node.load_attribute_by_short_filename('source', 'nginx') if node.respond_to?(:load_attribute_by_short_filename) nginx_url = node['nginx']['source']['url'] || - "http://nginx.org/download/nginx-#{node['nginx']['version']}.tar.gz" + "http://nginx.org/download/nginx-#{node['nginx']['source']['version']}.tar.gz" node.set['nginx']['binary'] = node['nginx']['source']['sbin_path'] node.set['nginx']['daemon_disable'] = true @@ -42,7 +42,7 @@ include_recipe "nginx::commons_script" include_recipe "build-essential" -src_filepath = "#{Chef::Config['file_cache_path'] || '/tmp'}/nginx-#{node['nginx']['version']}.tar.gz" +src_filepath = "#{Chef::Config['file_cache_path'] || '/tmp'}/nginx-#{node['nginx']['source']['version']}.tar.gz" packages = value_for_platform( ["centos","redhat","fedora","amazon","scientific"] => {'default' => ['pcre-devel', 'openssl-devel']}, "gentoo" => {"default" => []}, @@ -160,7 +160,7 @@ cwd ::File.dirname(src_filepath) code <<-EOH tar zxf #{::File.basename(src_filepath)} -C #{::File.dirname(src_filepath)} && - cd nginx-#{node['nginx']['version']} && + cd nginx-#{node['nginx']['source']['version']} && ./configure #{node.run_state['nginx_configure_flags'].join(" ")} && make && make install EOH @@ -168,7 +168,7 @@ not_if do nginx_force_recompile == false && node.automatic_attrs['nginx'] && - node.automatic_attrs['nginx']['version'] == node['nginx']['version'] && + node.automatic_attrs['nginx']['version'] == node['nginx']['source']['version'] && node.automatic_attrs['nginx']['configure_arguments'].sort == configure_flags.sort end