]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Merge pull request #993 from kenyon/source_weak_ssl
authordaianamezdrea <46529728+daianamezdrea@users.noreply.github.com>
Mon, 26 Jul 2021 13:33:46 +0000 (16:33 +0300)
committerGitHub <noreply@github.com>
Mon, 26 Jul 2021 13:33:46 +0000 (16:33 +0300)
apt::source: pass the weak_ssl param to apt::key

manifests/source.pp
spec/defines/source_spec.rb

index 6631eeaef46fca2d56a31e0578308d107a6416b0..4e14d8a0a53d95afb9cac6d300d1119904809a08 100644 (file)
@@ -36,8 +36,8 @@
 #
 # @param key
 #   Creates a declaration of the apt::key defined type. Valid options: a string to be passed to the `id` parameter of the `apt::key`
-#   defined type, or a hash of `parameter => value` pairs to be passed to `apt::key`'s `id`, `server`, `content`, `source`, and/or
-#   `options` parameters.
+#   defined type, or a hash of `parameter => value` pairs to be passed to `apt::key`'s `id`, `server`, `content`, `source`, `weak_ssl`,
+#   and/or `options` parameters.
 #
 # @param keyring
 #   Absolute path to a file containing the PGP keyring used to sign this repository. Value is used to set signed-by on the source entry.
@@ -172,13 +172,14 @@ define apt::source(
       }
 
       apt::key { "Add key: ${$_key['id']} from Apt::Source ${title}":
-        ensure  => $_ensure,
-        id      => $_key['id'],
-        server  => $_key['server'],
-        content => $_key['content'],
-        source  => $_key['source'],
-        options => $_key['options'],
-        before  => $_before,
+        ensure   => $_ensure,
+        id       => $_key['id'],
+        server   => $_key['server'],
+        content  => $_key['content'],
+        source   => $_key['source'],
+        options  => $_key['options'],
+        weak_ssl => $_key['weak_ssl'],
+        before   => $_before,
       }
     }
   }
index 2ce50a2f03f0dd8a20f6f3774066445a7afc0850..f6c2e23425e35571b1666330bd19acac101462c1 100644 (file)
@@ -109,11 +109,14 @@ describe 'apt::source' do
           location: 'http://debian.mirror.iweb.ca/debian/',
           release: 'sid',
           repos: 'testing',
-          key: { 'ensure' => 'refreshed',
-                 'id' => GPG_KEY_ID,
-                 'server' => 'pgp.mit.edu',
-                 'content' => 'GPG key content',
-                 'source'  => 'http://apt.puppetlabs.com/pubkey.gpg' },
+          key: {
+            'ensure' => 'refreshed',
+            'id' => GPG_KEY_ID,
+            'server' => 'pgp.mit.edu',
+            'content' => 'GPG key content',
+            'source'  => 'http://apt.puppetlabs.com/pubkey.gpg',
+            'weak_ssl' => true,
+          },
           pin: '10',
           architecture: 'x86_64',
           allow_unsigned: true,
@@ -136,7 +139,8 @@ describe 'apt::source' do
                                                                                                                                                     id: GPG_KEY_ID,
                                                                                                                                                     server: 'pgp.mit.edu',
                                                                                                                                                     content: 'GPG key content',
-                                                                                                                                                    source: 'http://apt.puppetlabs.com/pubkey.gpg')
+                                                                                                                                                    source: 'http://apt.puppetlabs.com/pubkey.gpg',
+                                                                                                                                                    weak_ssl: true)
       }
     end
   end