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,
11 validate_re($id, ['\A(0x)?[0-9a-fA-F]{8}\Z', '\A(0x)?[0-9a-fA-F]{16}\Z', '\A(0x)?[0-9a-fA-F]{40}\Z'])
14 validate_re($source, ['\Ahttps?:\/\/', '\Aftp:\/\/', '\A\/\w+'])
18 validate_re($server,['\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$'])
23 if defined(Anchor["apt_key ${id} absent"]){
24 fail("key with id ${id} already ensured as absent")
27 if !defined(Anchor["apt_key ${id} present"]) {
35 } -> anchor { "apt_key ${id} present": }
37 case $facts['os']['name'] {
39 if versioncmp($facts['os']['release']['full'], '9.0') >= 0 {
40 Apt::Key<| title == $title |> {
41 require => Package['dirmngr']
46 if versioncmp($facts['os']['release']['full'], '17.04') >= 0 {
47 Apt::Key<| title == $title |> {
48 require => Package['dirmngr']
58 if defined(Anchor["apt_key ${id} present"]){
59 fail("key with id ${id} already ensured as present")
62 if !defined(Anchor["apt_key ${id} absent"]){
70 } -> anchor { "apt_key ${id} absent": }
75 fail "Invalid 'ensure' value '${ensure}' for apt::key"