4 Enum['present', 'absent'] $ensure = present,
5 Optional[String] $content = undef,
6 Optional[String] $source = undef,
7 String $server = $::apt::keyserver,
8 Optional[String] $options = undef,
13 /\A(0x)?[0-9a-fA-F]{8}\Z/,
14 /\A(0x)?[0-9a-fA-F]{16}\Z/,
15 /\A(0x)?[0-9a-fA-F]{40}\Z/,
19 assert_type(Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/], $source)
23 assert_type(Pattern[/\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/], $server)
28 if defined(Anchor["apt_key ${id} absent"]){
29 fail("key with id ${id} already ensured as absent")
32 if !defined(Anchor["apt_key ${id} present"]) {
40 } -> anchor { "apt_key ${id} present": }
42 case $facts['os']['name'] {
44 if versioncmp($facts['os']['release']['major'], '9') >= 0 {
45 ensure_packages(['dirmngr'])
46 Apt::Key<| title == $title |>
50 if versioncmp($facts['os']['release']['full'], '17.04') >= 0 {
51 ensure_packages(['dirmngr'])
52 Apt::Key<| title == $title |>
61 if defined(Anchor["apt_key ${id} present"]){
62 fail("key with id ${id} already ensured as present")
65 if !defined(Anchor["apt_key ${id} absent"]){
73 } -> anchor { "apt_key ${id} absent": }
78 fail "Invalid 'ensure' value '${ensure}' for apt::key"