From a4f4c6d72eb54407cda04824e107f19dc389631f Mon Sep 17 00:00:00 2001 From: "Robert A. Vincent II (Bob-Vee)" Date: Mon, 25 Apr 2022 18:34:15 -0400 Subject: [PATCH] Add missing docs --- README.md | 5 +++-- REFERENCE.md | 2 +- lib/puppet/type/archive.rb | 7 ++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8b8109ca..6a82b15e 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|ftp|file 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..449195ac 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -991,7 +991,7 @@ Default value: `none` ##### `checksum_url` -archive file checksum source (instead of specifying checksum) +archive file checksum source (instead of specifying checksum). Supports http|https|ftp|file ##### `checksum_verify` diff --git a/lib/puppet/type/archive.rb b/lib/puppet/type/archive.rb index 8a0c2ff8..2c8d3d1e 100644 --- a/lib/puppet/type/archive.rb +++ b/lib/puppet/type/archive.rb @@ -174,7 +174,12 @@ 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|ftp|file' + validate do |value| + unless value =~ URI.regexp(%w[http https ftp file]) + raise ArgumentError, "invalid source url: #{value}" + end + end end newparam(:digest_url) do desc 'archive file checksum source (instead of specifying checksum)