chef-nexus-repository-manager icon indicating copy to clipboard operation
chef-nexus-repository-manager copied to clipboard

Extend tar_extract to extract from local file

Open Bruce17 opened this issue 5 years ago • 0 comments

Hi,

we have a corporate proxy, so I provided the nexus package in our local Artifactory and adjusted the variable NEXUS_DOWNLOAD_URL. The download url is over https using a self signed corporate ssl certifacte. Internally the tar_extract is not able to either fetch the certificate from the local system nor to ignore the ssl certificate issue (skip ssl verify).

Therefore I used curl to download the nexus artifact and tried to feed it locally to tar_extract.

A solution can be to adjust tar_extract in download.rb file as following:

tar_extract node['nexus_repository_manager']['nexus_download_url'] do
  action :extract_local
  target_dir node['nexus_repository_manager']['nexus_home']['path']
  checksum node['nexus_repository_manager']['nexus_download_sha256']
  creates node['nexus_repository_manager']['nexus_home']['path'] + '/bin'
  tar_flags [ '-P', '--strip-components 1' ]
end

Adding action :extract_local hard coded is not optimal I know, but maybe there is a solution to pass the configuration via an environment variable as the other options.

Bruce17 avatar Aug 02 '19 12:08 Bruce17