Wget works manually but doesn't work in Chef bash

[UPDATED] actually modified

I wrote this script to extract the setup file from the AWS S3 bucket. It works manually using wget in the terminal, but doesn't work in Chef run.

Mistake:

Resolving s3.amazonaws.com... failed: No address associated with hostname.
wget: unable to resolve host address "s3.amazonaws.com"

      

Script:

bash 'hp_file' do
  user 'root'
  cwd '/tmp'
  code <<-EOH
  wget https://s3.amazonaws.com/preprod.useast1/Platforms/HP+OM/Software_Operations_Agent_v11.14_Linux_ISO_TC200-88000.iso
  EOH
end

      

Any idea what went wrong? I have read a few questions about the interpolation issue, but that doesn't seem to be the reason in my case. Any help is appreciated. Thank.

+3


source to share


1 answer


Here is the solution that solved the problem. Client-the chef did not use the global proxy settings ( $http_proxy

and $https_proxy

). The fix was to change client.rb by adding this line:



http_proxy 'http://http-proxy.example.com:port'

      

0


source







All Articles