3 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,
4 Enum['present', 'absent'] $ensure = present,
5 Optional[String] $content = undef,
6 Optional[Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/]] $source = undef,
7 Pattern[/\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/] $server = $::apt::keyserver,
8 Optional[String] $options = undef,
13 if defined(Anchor["apt_key ${id} absent"]){
14 fail("key with id ${id} already ensured as absent")
17 if !defined(Anchor["apt_key ${id} present"]) {
25 } -> anchor { "apt_key ${id} present": }
27 case $facts['os']['name'] {
29 if versioncmp($facts['os']['release']['major'], '9') >= 0 {
30 ensure_packages(['dirmngr'])
31 Apt::Key<| title == $title |>
35 if versioncmp($facts['os']['release']['full'], '17.04') >= 0 {
36 ensure_packages(['dirmngr'])
37 Apt::Key<| title == $title |>
46 if defined(Anchor["apt_key ${id} present"]){
47 fail("key with id ${id} already ensured as present")
50 if !defined(Anchor["apt_key ${id} absent"]){
58 } -> anchor { "apt_key ${id} absent": }
63 fail "Invalid 'ensure' value '${ensure}' for apt::key"