diff --git a/cookbooks/gitea/install.rb b/cookbooks/gitea/install.rb index 433914e..0d54f07 100644 --- a/cookbooks/gitea/install.rb +++ b/cookbooks/gitea/install.rb @@ -13,7 +13,7 @@ begin Timeout.timeout(3) do response = Net::HTTP.get_response(uri) - vtag = $1 if response.body =~ %r{tag\/(v\d+\.\d+\.\d+)} + vtag = $1 if response['location'] =~ %r{tag\/(v\d+\.\d+\.\d+)} tag = vtag.sub(/^v/, '') gitea_bin = "#{node['gitea']['prefix']}#{tag}#{node['gitea']['postfix']}" diff --git a/cookbooks/loki/install.rb b/cookbooks/loki/install.rb index 289fcee..3f5abbb 100644 --- a/cookbooks/loki/install.rb +++ b/cookbooks/loki/install.rb @@ -13,7 +13,7 @@ begin Timeout.timeout(3) do response = Net::HTTP.get_response(uri) - vtag = $1 if response.body =~ %r{tag\/(v\d+\.\d+\.\d+)} + vtag = $1 if response['location'] =~ %r{tag\/(v\d+\.\d+\.\d+)} tag = vtag.sub(/^v/, '') loki_bin = "#{node['loki']['zip']}" diff --git a/cookbooks/nginx/build.rb b/cookbooks/nginx/build.rb index 0851101..7afd79e 100644 --- a/cookbooks/nginx/build.rb +++ b/cookbooks/nginx/build.rb @@ -38,7 +38,7 @@ begin Timeout.timeout(3) do response = Net::HTTP.get_response(uri) - if response.body =~ %r{tag\/(v\d+\.\d+\.\d+)} + if response['location'] =~ %r{tag\/(v\d+\.\d+\.\d+)} vtag = $1 tag_version = vtag.sub('v', '') diff --git a/cookbooks/nginx/lego.rb b/cookbooks/nginx/lego.rb index 9edb3ed..64d4cd8 100644 --- a/cookbooks/nginx/lego.rb +++ b/cookbooks/nginx/lego.rb @@ -24,7 +24,7 @@ begin Timeout.timeout(3) do response = Net::HTTP.get_response(uri) - if response.body =~ %r{tag\/(v\d+\.\d+\.\d+)} + if response['location'] =~ %r{tag\/(v\d+\.\d+\.\d+)} vtag = $1 tag_version = vtag.sub('v', '') diff --git a/cookbooks/prometheus/alertmanager_install.rb b/cookbooks/prometheus/alertmanager_install.rb index b182f28..4848e02 100644 --- a/cookbooks/prometheus/alertmanager_install.rb +++ b/cookbooks/prometheus/alertmanager_install.rb @@ -13,7 +13,7 @@ begin Timeout.timeout(3) do response = Net::HTTP.get_response(uri) - vtag = $1 if response.body =~ %r{tag\/(v\d+\.\d+\.\d+)} + vtag = $1 if response['location'] =~ %r{tag\/(v\d+\.\d+\.\d+)} tag = vtag.sub(/^v/, '') alertmanager_bin = "#{node['alertmanager']['prefix']}#{tag}#{node['alertmanager']['postfix']}" diff --git a/cookbooks/prometheus/alertmanager_webhook_install.rb b/cookbooks/prometheus/alertmanager_webhook_install.rb index 0420e26..060aeb3 100644 --- a/cookbooks/prometheus/alertmanager_webhook_install.rb +++ b/cookbooks/prometheus/alertmanager_webhook_install.rb @@ -12,7 +12,7 @@ begin Timeout.timeout(3) do response = Net::HTTP.get_response(uri) - tag = $1 if response.body =~ %r{tag\/(\d+\.\d+)} + tag = $1 if response['location'] =~ %r{tag\/(\d+\.\d+)} alertmanager_webhook_bin = "#{node['alertmanager_webhook']['prefix']}#{tag}#{node['alertmanager_webhook']['postfix']}" diff --git a/cookbooks/prometheus/prometheus_install.rb b/cookbooks/prometheus/prometheus_install.rb index 3891116..7cb4896 100644 --- a/cookbooks/prometheus/prometheus_install.rb +++ b/cookbooks/prometheus/prometheus_install.rb @@ -13,7 +13,7 @@ begin Timeout.timeout(3) do response = Net::HTTP.get_response(uri) - vtag = $1 if response.body =~ %r{tag\/(v\d+\.\d+\.\d+)} + vtag = $1 if response['location'] =~ %r{tag\/(v\d+\.\d+\.\d+)} tag = vtag.sub(/^v/, '') prometheus_bin = "#{node['prometheus']['prefix']}#{tag}#{node['prometheus']['postfix']}" diff --git a/cookbooks/prometheus/snmp_exporter_install.rb b/cookbooks/prometheus/snmp_exporter_install.rb index fb75001..e9876e0 100644 --- a/cookbooks/prometheus/snmp_exporter_install.rb +++ b/cookbooks/prometheus/snmp_exporter_install.rb @@ -13,7 +13,7 @@ begin Timeout.timeout(3) do response = Net::HTTP.get_response(uri) - vtag = $1 if response.body =~ %r{tag\/(v\d+\.\d+\.\d+)} + vtag = $1 if response['location'] =~ %r{tag\/(v\d+\.\d+\.\d+)} tag = vtag.sub(/^v/, '') snmp_bin = "#{node['snmp_exporter']['prefix']}#{tag}#{node['snmp_exporter']['postfix']}"