example42 / puppi

Puppet module to manage applications deployments and servers local management
http://www.example42.com
Other
142 stars 84 forks source link

Ordering of ppreextract_command #83

Closed gregcoit closed 10 years ago

gregcoit commented 11 years ago

Hello,

When downloading a tar.gz from github, the file get's placed in the work_dir without the .tar.gz extension (this is a bug in either github or wget, not netinstall).

I have tried to following to fix the issue:

puppi::netinstall { 'icecast': url => 'https://github.com/karlheyes/icecast-kh/archive/icecast-2.3.3-kh9.tar.gz', destination_dir => '/usr/local/src/', preextract_command => 'mv /var/tmp/icecast-2.3.3-kh9 /var/tmp/icecast-2.3.3-kh9.tar.gz', postextract_command => "/usr/local/src/icecast-2.3.3-kh9/configure && /usr/bin/make && /usr/bin/make install", }

but get the following:

Notice: /Stage[main]/Icecast/Puppi::Netinstall[icecast]/Exec[Retrieve https://github.com/karlheyes/icecast-kh/archive/icecast-2.3.3-kh9.tar.gz in /var/tmp]/returns: executed successfully Info: /Stage[main]/Icecast/Puppi::Netinstall[icecast]/Exec[Retrieve https://github.com/karlheyes/icecast-kh/archive/icecast-2.3.3-kh9.tar.gz in /var/tmp]: Scheduling refresh of Exec[PreExtract icecast-2.3.3-kh9.tar.gz in /usr/local/src/] Notice: /Stage[main]/Icecast/Puppi::Netinstall[icecast]/Exec[Extract icecast-2.3.3-kh9.tar.gz from /var/tmp]/returns: tar (child): /var/tmp/icecast-2.3.3-kh9.tar.gz: Cannot open: No such file or directory Notice: /Stage[main]/Icecast/Puppi::Netinstall[icecast]/Exec[Extract icecast-2.3.3-kh9.tar.gz from /var/tmp]/returns: tar (child): Error is not recoverable: exiting now Notice: /Stage[main]/Icecast/Puppi::Netinstall[icecast]/Exec[Extract icecast-2.3.3-kh9.tar.gz from /var/tmp]/returns: tar: Child returned status 2 Notice: /Stage[main]/Icecast/Puppi::Netinstall[icecast]/Exec[Extract icecast-2.3.3-kh9.tar.gz from /var/tmp]/returns: tar: Error is not recoverable: exiting now Error: mkdir -p /usr/local/src/ && cd /usr/local/src/ && tar -zxf /var/tmp/icecast-2.3.3-kh9.tar.gz returned 2 instead of one of [0] Error: /Stage[main]/Icecast/Puppi::Netinstall[icecast]/Exec[Extract icecast-2.3.3-kh9.tar.gz from /var/tmp]/returns: change from notrun to 0 failed: mkdir -p /usr/local/src/ && cd /usr/local/src/ && tar -zxf /var/tmp/icecast-2.3.3-kh9.tar.gz returned 2 instead of one of [0] Notice: /Stage[main]/Icecast/Puppi::Netinstall[icecast]/Exec[Chown icecast-2.3.3-kh9.tar.gz in /usr/local/src/]: Dependency Exec[Extract icecast-2.3.3-kh9.tar.gz from /var/tmp] has failures: true Warning: /Stage[main]/Icecast/Puppi::Netinstall[icecast]/Exec[Chown icecast-2.3.3-kh9.tar.gz in /usr/local/src/]: Skipping because of failed dependencies Notice: /Stage[main]/Icecast/Puppi::Netinstall[icecast]/Exec[PostExtract icecast-2.3.3-kh9.tar.gz in /usr/local/src/]: Dependency Exec[Extract icecast-2.3.3-kh9.tar.gz from /var/tmp] has failures: true Warning: /Stage[main]/Icecast/Puppi::Netinstall[icecast]/Exec[PostExtract icecast-2.3.3-kh9.tar.gz in /usr/local/src/]: Skipping because of failed dependencies Notice: /Stage[main]/Icecast/Puppi::Netinstall[icecast]/Exec[PreExtract icecast-2.3.3-kh9.tar.gz in /usr/local/src/]: Triggered 'refresh' from 1 events Notice: Finished catalog run in 6.06 seconds

It appears that netinstall is trying to do something to the file in between downloading it to the word_dir and running the preextract_command.

Thanks!

Greg

alvagante commented 11 years ago

You can try to use an alternative fetch program (default is wget) or different options to pass to the command with with the parameters: $retrieve_command = 'wget', $retrieve_args = '', so that the fetch command doesn't rename the downloaded file stripping the .tar.gz

gregcoit commented 11 years ago

Alessandro,

Thank you for the response - this worked perfectly!

Regards,

Greg

Greg Coit gregcoit@gmail.com 707-845-0317

On Sat, Sep 28, 2013 at 12:01 AM, Alessandro Franceschi < notifications@github.com> wrote:

You can try to use an alternative fetch program (default is wget) or different options to pass to the command with with the parameters: $retrieve_command = 'wget', $retrieve_args = '', so that the fetch command doesn't rename the downloaded file stripping the .tar.gz

— Reply to this email directly or view it on GitHubhttps://github.com/example42/puppi/issues/83#issuecomment-25293225 .