Adding dash to key_server validate regex
[puppet-modules/puppetlabs-apt.git] / lib / puppet / type / apt_key.rb
index fa7b0c676c77e2c4c1d48eeaa37a1cd677a27076..e2cb8d9cf92695dded9d331b627dc7759abc9092 100644 (file)
@@ -60,10 +60,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,4})?$/)
   end
 
   newparam(:keyserver_options) do