X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=lib%2Fpuppet%2Ftype%2Fapt_key.rb;h=8aa408193c802b8f9dcdd41d8602f3eaa0898a38;hb=b0e0024730d3463153afe5af03fd66e4244bea81;hp=67420de0fad9502b83202ab0e21eba0493f2eacc;hpb=374101612c035ec5765c767d234d127d5c7a4870;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/lib/puppet/type/apt_key.rb b/lib/puppet/type/apt_key.rb index 67420de..8aa4081 100644 --- a/lib/puppet/type/apt_key.rb +++ b/lib/puppet/type/apt_key.rb @@ -36,11 +36,7 @@ Puppet::Type.newtype(:apt_key) do else id = value.upcase end - if id.length == 16 - id[8..-1] - else - id - end + id end end @@ -49,8 +45,8 @@ Puppet::Type.newtype(:apt_key) do end newparam(:source) do - desc 'Location of a GPG key file, /path/to/file, http:// or https://' - newvalues(/\Ahttps?:\/\//, /\A\/\w+/) + desc 'Location of a GPG key file, /path/to/file, ftp://, http:// or https://' + newvalues(/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/) end autorequire(:file) do @@ -60,10 +56,10 @@ Puppet::Type.newtype(:apt_key) do end newparam(:server) do - desc 'The key server to fetch the key from based on the ID.' + desc 'The key server to fetch the key from based on the ID. It can either be a domain name or url.' defaultto :'keyserver.ubuntu.com' - # Need to validate this, preferably through stdlib is_fqdn - # but still working on getting to that. + + newvalues(/\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/) end newparam(:keyserver_options) do