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,
9 Optional[Variant[String, Hash]] $key = undef,
10 Optional[String] $key_content = undef,
11 Optional[String] $key_source = undef,
12 Optional[String] $key_server = undef,
13 Optional[String] $key_options = undef,
17 deprecation('apt $key', '$key is deprecated and will be removed in the next major release. Please use $id instead.')
23 if $key_content != undef {
24 deprecation('apt $key_content', '$key_content is deprecated and will be removed in the next major release. Please use $content instead.')
25 $_content = $key_content
30 if $key_source != undef {
31 deprecation('apt $key_source', '$key_source is deprecated and will be removed in the next major release. Please use $source instead.')
32 $_source = $key_source
37 if $key_server != undef {
38 deprecation('apt $key_server', '$key_server is deprecated and will be removed in the next major release. Please use $server instead.')
39 $_server = $key_server
44 if $key_options != undef {
45 deprecation('apt $key_options', '$key_options is deprecated and will be removed in the next major release. Please use $options instead.')
46 $_options = $key_options
51 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'])
54 validate_re($_source, ['\Ahttps?:\/\/', '\Aftp:\/\/', '\A\/\w+'])
58 validate_re($_server,['\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$'])
63 if defined(Anchor["apt_key ${_id} absent"]){
64 fail("key with id ${_id} already ensured as absent")
67 if !defined(Anchor["apt_key ${_id} present"]) {
75 } -> anchor { "apt_key ${_id} present": }
80 if defined(Anchor["apt_key ${_id} present"]){
81 fail("key with id ${_id} already ensured as present")
84 if !defined(Anchor["apt_key ${_id} absent"]){
92 } -> anchor { "apt_key ${_id} absent": }
97 fail "Invalid 'ensure' value '${ensure}' for apt::key"