X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fkey.pp;h=7eaf4d9f6515902c007d0ccb7cf21300e34cb6da;hb=9b3254ee4599c9e2b068874c05f8d271689ada2f;hp=1933b3f9110b996e666208132e06188d1dc8c5a6;hpb=dc3ead0ed5f4d735869565660c982983d379a519;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/key.pp b/manifests/key.pp index 1933b3f..7eaf4d9 100644 --- a/manifests/key.pp +++ b/manifests/key.pp @@ -1,27 +1,12 @@ # == Define: apt::key define apt::key ( - String $id = $title, - Enum['present', 'absent'] $ensure = present, - Optional[String] $content = undef, - Optional[String] $source = undef, - String $server = $::apt::keyserver, - Optional[String] $options = undef, - ) { - - assert_type( - Pattern[ - /\A(0x)?[0-9a-fA-F]{8}\Z/, - /\A(0x)?[0-9a-fA-F]{16}\Z/, - /\A(0x)?[0-9a-fA-F]{40}\Z/, - ], $id) - - if $source { - assert_type(Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/], $source) - } - - if $server { - assert_type(Pattern[/\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/], $server) - } + Pattern[/\A(0x)?[0-9a-fA-F]{8}\Z/, /\A(0x)?[0-9a-fA-F]{16}\Z/, /\A(0x)?[0-9a-fA-F]{40}\Z/] $id = $title, + Enum['present', 'absent'] $ensure = present, + Optional[String] $content = undef, + Optional[Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/]] $source = undef, + Pattern[/\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/] $server = $::apt::keyserver, + Optional[String] $options = undef, + ) { case $ensure { present: {