example42 / puppet-kibana

Puppet module for Kibana 3 based on stdmod naming standards
Other
9 stars 11 forks source link

Alternate Kibana URLs are totally broken #3

Open smerrill opened 10 years ago

smerrill commented 10 years ago

If you set kibana::install_url to "https://download.elasticsearch.org/kibana/kibana/kibana-3.0.0milestone4.zip", you get the following error:

Error: mkdir -p /opt && cd /opt && unzip /var/tmp/kibana-3.0.0milestone4.zip  returned 9 instead of one of [0]
Error: /Stage[main]/Kibana::Install/Puppi::Netinstall[netinstall_kibana]/Exec[Extract kibana-3.0.0milestone4.zip from /var/tmp]/returns: change from notrun to 0 failed: mkdir -p /opt && cd /opt && unzip /var/tmp/kibana-3.0.0milestone4.zip  returned 9 instead of one of [0]
Warning: /Stage[main]/Kibana::Install/Puppi::Netinstall[netinstall_kibana]/Exec[Chown kibana-3.0.0milestone4.zip in /opt]: Skipping because of failed dependencies
Warning: /File[kibana.conf]: Skipping because of failed dependencies

This is because the file is downloaded to /var/tmp/kibana-3.0.0milestone4 and not /var/tmp/kibana-3.0.0milestone4.zip.

You get a different error with the .tar.gz file since the puppi parse_url() function has trouble with double file extension.

smerrill commented 10 years ago

I was able to make this work for .zip values of kibana::install_url by changing lines 77-80 to the following:

if $kibana::install_url {
  $managed_install_url = $kibana::install_url
  $download_file_name = url_parse($kibana::install_url,'filename')
  $extracted_dir = url_parse($download_file_name,'filedir')
alvagante commented 10 years ago

Keeping track of changing upstream urls is a big pain :-I If you have a working fix a PR is welcomed

johnnyrun commented 10 years ago

Hi Alessandro. Same problem here. Your module download in: /var/tmp/archivename and try to extract: /var/tmp/archivename.zip

the @smerrill patch is working very good here.

alvagante commented 10 years ago

PR with the fix welcomed