From 65b5e033550bd34cb394be664bc54cd93cb9c0a1 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Wed, 13 Sep 2017 11:16:36 +0200 Subject: [PATCH] autorequire dirmngr package * add Debian 9 as supported system * move dirmngr ensure to init.pp --- manifests/init.pp | 15 +++++++++++++++ manifests/key.pp | 18 ++++++++++++++++++ manifests/setting.pp | 15 --------------- metadata.json | 3 ++- 4 files changed, 35 insertions(+), 16 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index c89c223..44e66ce 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -178,4 +178,19 @@ class apt ( 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: { } + } } diff --git a/manifests/key.pp b/manifests/key.pp index dfa1daf..31fc485 100644 --- a/manifests/key.pp +++ b/manifests/key.pp @@ -33,6 +33,24 @@ define apt::key ( server => $server, options => $options, } -> anchor { "apt_key ${id} present": } + + case $facts['os']['name'] { + 'Debian': { + if versioncmp($facts['os']['release']['full'], '9.0') >= 0 { + AptKey<| title == $title |> { + require => Package['dirmngr'] + } + } + } + 'Ubuntu': { + if versioncmp($facts['os']['release']['full'], '17.04') >= 0 { + AptKey<| title == $title |> { + require => Package['dirmngr'] + } + } + } + default: { } + } } } diff --git a/manifests/setting.pp b/manifests/setting.pp index 333f553..3809239 100644 --- a/manifests/setting.pp +++ b/manifests/setting.pp @@ -50,19 +50,4 @@ define apt::setting ( notify => $_notify, } - # required for adding apt GPG keys - 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: { } - } - } diff --git a/metadata.json b/metadata.json index a307e5d..4e65705 100644 --- a/metadata.json +++ b/metadata.json @@ -16,7 +16,8 @@ "operatingsystem": "Debian", "operatingsystemrelease": [ "7", - "8" + "8", + "9" ] }, { -- 2.32.3