Skip to content

Commit

Permalink
[COOK-1053] - Add url attribute to nginx cookbook
Browse files Browse the repository at this point in the history
  • Loading branch information
fnichol authored and jtimberman committed Mar 8, 2012
1 parent 6f7e2ea commit 63f0dbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions nginx/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
# limitations under the License.
#

default[:nginx][:version] = "1.0.12"
default[:nginx][:version] = "1.0.12"
default[:nginx][:url] = "http://nginx.org/download/nginx-#{node[:nginx][:version]}.tar.gz"

case platform
when "debian","ubuntu"
Expand All @@ -39,11 +40,11 @@

default[:nginx][:pid] = "/var/run/nginx.pid"

default[:nginx][:gzip] = "on"
default[:nginx][:gzip] = "on"
default[:nginx][:gzip_http_version] = "1.0"
default[:nginx][:gzip_comp_level] = "2"
default[:nginx][:gzip_proxied] = "any"
default[:nginx][:gzip_types] = [
default[:nginx][:gzip_comp_level] = "2"
default[:nginx][:gzip_proxied] = "any"
default[:nginx][:gzip_types] = [
"text/plain",
"text/html",
"text/css",
Expand Down
3 changes: 2 additions & 1 deletion nginx/recipes/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
end

nginx_version = node[:nginx][:version]
src_url = node[:nginx][:url]

node.set[:nginx][:install_path] = "/opt/nginx-#{nginx_version}"
node.set[:nginx][:src_binary] = "#{node[:nginx][:install_path]}/sbin/nginx"
Expand All @@ -46,7 +47,7 @@
configure_flags = node[:nginx][:configure_flags].join(" ")

remote_file "#{Chef::Config[:file_cache_path]}/nginx-#{nginx_version}.tar.gz" do
source "http://nginx.org/download/nginx-#{nginx_version}.tar.gz"
source src_url
action :create_if_missing
end

Expand Down

0 comments on commit 63f0dbb

Please sign in to comment.