From: david22swan Date: Mon, 20 Jun 2022 10:09:40 +0000 (+0100) Subject: (ISSUE-1036) Conditional `gnupg` include added to init.pp X-Git-Tag: v8.4.1~1^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=8d35d59d7dbd7bf764557f73cce0b0c06fa9aa70;hp=f837fd29667f46e8d729198291c98f5b1ac171af;p=puppet-modules%2Fpuppetlabs-apt.git (ISSUE-1036) Conditional `gnupg` include added to init.pp Originally removed as it was causing `gnupg` to be installed in all OS when it wasn't needed, removing it seems to have caused a dependency cycle in the relevant Debian family OS for certain community members. Adding the include back within a conditional statement to solve the issue while still preventing it from being included when unneeded. --- diff --git a/manifests/init.pp b/manifests/init.pp index 4aa4a68..7043110 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -358,4 +358,20 @@ class apt ( if $pins { create_resources('apt::pin', $pins) } + + case $facts['os']['name'] { + 'Debian': { + if versioncmp($facts['os']['release']['major'], '9') >= 0 { + ensure_packages(['gnupg']) + } + } + 'Ubuntu': { + if versioncmp($facts['os']['release']['full'], '17.04') >= 0 { + ensure_packages(['gnupg']) + } + } + default: { + # Nothing in here + } + } }