Merge pull request #429 from mhaskel/remove_include_update
[puppet-modules/puppetlabs-apt.git] / manifests / key.pp
index c51f4bfa562d4bf7f0d93f63723b927e03010a84..ce5fc2514cee6c27d32be04cd0cdaf3f47dac359 100644 (file)
 # [*key*]
 #   _default_: +$title+, the title/name of the resource
 #
-#   Is a GPG key ID. This key ID is validated with a regex enforcing it
-#   to only contain valid hexadecimal characters, be precisely 8 or 16
-#   characters long and optionally prefixed with 0x.
+#   Is a GPG key ID or full key fingerprint. This value is validated with
+#   a regex enforcing it to only contain valid hexadecimal characters, be
+#   precisely 8 or 16 hexadecimal characters long and optionally prefixed
+#   with 0x for key IDs, or 40 hexadecimal characters long for key
+#   fingerprints.
 #
 # [*ensure*]
 #   _default_: +present+
@@ -57,7 +59,7 @@ define apt::key (
   $key_options = undef,
 ) {
 
-  validate_re($key, ['\A(0x)?[0-9a-fA-F]{8}\Z', '\A(0x)?[0-9a-fA-F]{16}\Z'])
+  validate_re($key, ['\A(0x)?[0-9a-fA-F]{8}\Z', '\A(0x)?[0-9a-fA-F]{16}\Z', '\A(0x)?[0-9a-fA-F]{40}\Z'])
   validate_re($ensure, ['\Aabsent|present\Z',])
 
   if $key_content {