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']['full'], '9.0') >= 0 {
45 Apt::Key<| title == $title |> {
46 require => Package['dirmngr']
51 if versioncmp($facts['os']['release']['full'], '17.04') >= 0 {
52 Apt::Key<| title == $title |> {
53 require => Package['dirmngr']
63 if defined(Anchor["apt_key ${id} present"]){
64 fail("key with id ${id} already ensured as present")
67 if !defined(Anchor["apt_key ${id} absent"]){
75 } -> anchor { "apt_key ${id} absent": }
80 fail "Invalid 'ensure' value '${ensure}' for apt::key"