-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make our type camptocamp/archive compatible #176
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# == Definition: archive::download | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @igalic Maybe document this type as for compatibility with camptocamp? You would otherwise always use the native There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it wasn't documented in camptocamp/archive either There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry, I wasn't clear (story of my life!) I don't mean document all the parameters etc. I mean just add a line to say that it is a shim/private etc. Something to discourage new users from thinking this is the way they should be using the module. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar to how the new parameters in the type are marked |
||
# | ||
# Archive downloader with integrity verification. | ||
# | ||
# Parameters: | ||
# | ||
# - *$url: | ||
# - *$digest_url: | ||
# - *$digest_string: Default value undef | ||
# - *$digest_type: Default value "md5". | ||
# - *$timeout: Default value 120. (ignored) | ||
# - *$src_target: Default value "/usr/src". | ||
# - *$allow_insecure: Default value false. | ||
# - *$follow_redirects: Default value false. | ||
# - *$verbose: Default value true. | ||
# - *$proxy_server: Default value undef. | ||
# - *$user: The user used to download the archive | ||
# | ||
# Example usage: | ||
# | ||
# archive::download {"apache-tomcat-6.0.26.tar.gz": | ||
# ensure => present, | ||
# url => "http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.tar.gz", | ||
# } | ||
# | ||
# archive::download {"apache-tomcat-6.0.26.tar.gz": | ||
# ensure => present, | ||
# digest_string => "f9eafa9bfd620324d1270ae8f09a8c89", | ||
# url => "http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.tar.gz", | ||
# } | ||
# | ||
define archive::download ( | ||
$url, | ||
$ensure = present, | ||
$checksum = true, | ||
$digest_url = undef, | ||
$digest_string = undef, | ||
$digest_type = 'md5', # bad default! | ||
$timeout = 120, # ignored | ||
$src_target = '/usr/src', | ||
$allow_insecure = false, # ignored | ||
$follow_redirects = false, # ignored (default) | ||
$verbose = true, # ignored | ||
$path = $::path, # ignored | ||
$proxy_server = undef, | ||
$user = undef, | ||
) { | ||
|
||
$target = is_absolute_path($title) ? { | ||
false => "${src_target}/${title}", | ||
default => $title, | ||
} | ||
|
||
archive { $target: | ||
ensure => $ensure, | ||
source => $url, | ||
checksum_verify => $checksum, | ||
checksum => $digest_string, | ||
checksum_type => $digest_type, | ||
checksum_url => $digest_url, | ||
proxy_server => $proxy_server, | ||
user => $user, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is awful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but it works with the latest _release_ or rtyler/jenkins
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(a.k.a.: we're running it in prod now ;)