X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fkey.pp;h=f6c2f6161b171334a4d6f87dbd5dae441071dfc4;hb=0f4553312ee0a9ce56f9b0f8b7fc74c1c7503b6c;hp=48487632c18ccd37ce7d7eb46afda15a7083e578;hpb=5f91c2df3fc438538981c6bed46602c7d623a639;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/key.pp b/manifests/key.pp index 4848763..f6c2f61 100644 --- a/manifests/key.pp +++ b/manifests/key.pp @@ -40,14 +40,13 @@ define apt::key ( Enum['present', 'absent', 'refreshed'] $ensure = present, Optional[String] $content = undef, Optional[Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/]] $source = undef, - Pattern[/\A((hkp|hkps|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?(\/[a-zA-Z\d\-_.]+)*\/?$/] $server = $::apt::keyserver, + Pattern[/\A((hkp|hkps|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?(\/[a-zA-Z\d\-_.]+)*\/?$/] $server = $apt::keyserver, Boolean $weak_ssl = false, - Optional[String] $options = $::apt::key_options, - ) { - + Optional[String] $options = $apt::key_options, +) { case $ensure { /^(refreshed|present)$/: { - if defined(Anchor["apt_key ${id} absent"]){ + if defined(Anchor["apt_key ${id} absent"]) { fail("key with id ${id} already ensured as absent") } @@ -76,17 +75,19 @@ define apt::key ( Apt::Key<| title == $title |> } } - default: { } + default: { + # Nothing in here + } } } } - absent: { - if defined(Anchor["apt_key ${id} present"]){ + /^absent$/: { + if defined(Anchor["apt_key ${id} present"]) { fail("key with id ${id} already ensured as present") } - if !defined(Anchor["apt_key ${id} absent"]){ + if !defined(Anchor["apt_key ${id} absent"]) { apt_key { $title: ensure => $ensure, id => $id,