7 $server = $::apt::keyserver,
17 warning('$key is deprecated and will be removed in the next major release. Please use $id instead.')
23 if $key_content != undef {
24 warning('$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 warning('$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 warning('$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 warning('$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'])
52 validate_re($ensure, ['\Aabsent|present\Z',])
55 validate_string($_content)
59 validate_re($_source, ['\Ahttps?:\/\/', '\Aftp:\/\/', '\A\/\w+'])
63 validate_re($_server,['\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$'])
67 validate_string($_options)
72 if defined(Anchor["apt_key ${_id} absent"]){
73 fail("key with id ${_id} already ensured as absent")
76 if !defined(Anchor["apt_key ${_id} present"]) {
85 anchor { "apt_key ${_id} present": }
90 if defined(Anchor["apt_key ${_id} present"]){
91 fail("key with id ${_id} already ensured as present")
94 if !defined(Anchor["apt_key ${_id} absent"]){
101 options => $_options,
103 anchor { "apt_key ${_id} absent": }
108 fail "Invalid 'ensure' value '${ensure}' for apt::key"