(ISSUE-1036) Conditional `gnupg` include added to init.pp
authordavid22swan <david.swan@puppet.com>
Mon, 20 Jun 2022 10:09:40 +0000 (11:09 +0100)
committerdavid22swan <david.swan@puppet.com>
Mon, 20 Jun 2022 10:09:40 +0000 (11:09 +0100)
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.

manifests/init.pp

index 4aa4a68ccd4c70dd7d8a1267b2309caa8d09cdce..704311061b6df0e7f6d649c70721554e29d84ad1 100644 (file)
@@ -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
+    }
+  }
 }