key_output = apt_key(cli_args)
end
- pub_line, fpr_line = nil
+ pub_line, sub_line, fpr_line = nil
key_array = key_output.split("\n").collect do |line|
if line.start_with?('pub')
pub_line = line
# reset fpr_line, to skip any previous subkeys which were collected
fpr_line = nil
+ sub_line = nil
+ elsif line.start_with?('sub')
+ sub_line = line
elsif line.start_with?('fpr')
fpr_line = line
end
+ if (sub_line and fpr_line)
+ sub_line, fpr_line = nil
+ next
+ end
+
next unless (pub_line and fpr_line)
line_hash = key_line_hash(pub_line, fpr_line)
if $pins {
create_resources('apt::pin', $pins)
}
+
+ # required for adding GPG keys on Debian 9 (and derivatives)
+ case $facts['os']['name'] {
+ 'Debian': {
+ if versioncmp($facts['os']['release']['full'], '9.0') >= 0 {
+ ensure_packages(['dirmngr'])
+ }
+ }
+ 'Ubuntu': {
+ if versioncmp($facts['os']['release']['full'], '17.04') >= 0 {
+ ensure_packages(['dirmngr'])
+ }
+ }
+ default: { }
+ }
}
server => $server,
options => $options,
} -> anchor { "apt_key ${id} present": }
+
+ case $facts['os']['name'] {
+ 'Debian': {
+ if versioncmp($facts['os']['release']['full'], '9.0') >= 0 {
+ Apt::Key<| title == $title |> {
+ require => Package['dirmngr']
+ }
+ }
+ }
+ 'Ubuntu': {
+ if versioncmp($facts['os']['release']['full'], '17.04') >= 0 {
+ Apt::Key<| title == $title |> {
+ require => Package['dirmngr']
+ }
+ }
+ }
+ default: { }
+ }
}
}
"operatingsystem": "Debian",
"operatingsystemrelease": [
"7",
- "8"
+ "8",
+ "9"
]
},
{