X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=lib%2Fpuppet%2Ftype%2Fapt_key.rb;h=99be930e28b8e51ff47af87c2e568a33bb55f463;hb=a4609826c3dc663c2ebb5402ffe7b8a1ea1ecd4f;hp=e192077ae6fcfba966bc70a83ad94fa860dc2671;hpb=17b9a4481378fb50b5c3745824ae07ddbdd8e3fa;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/lib/puppet/type/apt_key.rb b/lib/puppet/type/apt_key.rb index e192077..99be930 100644 --- a/lib/puppet/type/apt_key.rb +++ b/lib/puppet/type/apt_key.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'pathname' require 'puppet/parameter/boolean' @@ -29,6 +31,7 @@ Puppet::Type.newtype(:apt_key) do if self[:content] && self[:source] raise(_('The properties content and source are mutually exclusive.')) end + if self[:id].length < 40 warning(_('The id should be a full fingerprint (40 characters), see README.')) end @@ -68,7 +71,7 @@ Puppet::Type.newtype(:apt_key) do desc 'The key server to fetch the key from based on the ID. It can either be a domain name or url.' defaultto :'keyserver.ubuntu.com' - newvalues(%r{\A((hkp|http|https)://)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$}) + newvalues(%r{\A((hkp|hkps|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?(\/[a-zA-Z\d\-_.]+)*\/?$}) end newparam(:options) do @@ -77,6 +80,12 @@ Puppet::Type.newtype(:apt_key) do newparam(:refresh, boolean: true, parent: Puppet::Parameter::Boolean) do desc 'When true, recreate an existing expired key' + defaultto false + end + + newparam(:weak_ssl, boolean: true, parent: Puppet::Parameter::Boolean) do + desc 'When true and source uses https, accepts download of keys without SSL verification' + defaultto false end newproperty(:fingerprint) do