diff --git a/README.md b/README.md index 8b8109ca..1552b83e 100644 --- a/README.md +++ b/README.md @@ -461,7 +461,7 @@ archive { '/tmp/staging/master.zip': * `ensure`: whether archive file should be present/absent (default: present) * `path`: namevar, archive file fully qualified file path. * `filename`: archive file name (derived from path). -* `source`: archive file source, supports http|https|ftp|file|s3|gs uri. +* `source`: archive file source, supports puppet|http|https|ftp|file|s3|gs uri. * `username`: username to download source file. * `password`: password to download source file. * `allow_insecure`: Ignore HTTPS certificate errors (true|false). (default: false) @@ -469,7 +469,8 @@ archive { '/tmp/staging/master.zip': * `checksum_type`: archive file checksum type (none|md5|sha1|sha2|sha256|sha384| sha512). (default: none) * `checksum`: archive file checksum (match checksum_type) -* `checksum_url`: archive file checksum source (instead of specify checksum) +* `checksum_url`: archive file checksum source (instead of specify checksum), + supports http|https uri. * `checksum_verify`: whether checksum will be verified (true|false). (default: true) * `extract`: whether archive will be extracted after download (true|false). (default: false) diff --git a/REFERENCE.md b/REFERENCE.md index 8dcadb20..2e24ac47 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -991,7 +991,8 @@ Default value: `none` ##### `checksum_url` -archive file checksum source (instead of specifying checksum) +archive file checksum source (instead of specifying checksum), +supports http|https ##### `checksum_verify` @@ -1095,7 +1096,7 @@ proxy type (none|ftp|http|https) ##### `source` -archive file source, supports puppet|http|https|ftp|file|s3|gs uri. +archive file source, supports puppet|http|https|ftp|file|s3|gs|abspath uri. ##### `target` @@ -1108,7 +1109,7 @@ used. ##### `url` -archive file source, supports http|https|ftp|file uri. +archive file source, supports puppet|http|https|ftp|file|s3|gs|abspath uri. (for camptocamp/archive compatibility) ##### `user` diff --git a/lib/puppet/type/archive.rb b/lib/puppet/type/archive.rb index 8a0c2ff8..b86dffca 100644 --- a/lib/puppet/type/archive.rb +++ b/lib/puppet/type/archive.rb @@ -122,7 +122,7 @@ def should_to_s(value) end newparam(:source) do - desc 'archive file source, supports puppet|http|https|ftp|file|s3|gs uri.' + desc 'archive file source, supports puppet|http|https|ftp|file|s3|gs|abspath uri.' validate do |value| unless value =~ URI.regexp(%w[puppet http https ftp file s3 gs]) || Puppet::Util.absolute_path?(value) raise ArgumentError, "invalid source url: #{value}" @@ -131,10 +131,10 @@ def should_to_s(value) end newparam(:url) do - desc 'archive file source, supports http|https|ftp|file uri. + desc 'archive file source, supports puppet|http|https|ftp|file|s3|gs|abspath uri. (for camptocamp/archive compatibility)' validate do |value| - unless value =~ URI.regexp(%w[http https file ftp]) + unless value =~ URI.regexp(%w[puppet http https ftp file s3 gs]) || Puppet::Util.absolute_path?(value) raise ArgumentError, "invalid source url: #{value}" end end @@ -174,7 +174,13 @@ def should_to_s(value) end newparam(:checksum_url) do - desc 'archive file checksum source (instead of specifying checksum)' + desc 'archive file checksum source (instead of specifying checksum), + supports http|https' + validate do |value| + unless value =~ URI.regexp(%w[http https]) + raise ArgumentError, "invalid checksum url: #{value}" + end + end end newparam(:digest_url) do desc 'archive file checksum source (instead of specifying checksum)