Code Review
/
puppet-modules
/
puppetlabs-apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge pull request #825 from eimlav/dirmngr-fix
[puppet-modules/puppetlabs-apt.git]
/
lib
/
puppet
/
type
/
apt_key.rb
diff --git
a/lib/puppet/type/apt_key.rb
b/lib/puppet/type/apt_key.rb
index 1778e4ba6c729fa758aae837b23629f76e4a4d14..467f568af4a74ff475fb2ed77da0e2c31298dc16 100644
(file)
--- a/
lib/puppet/type/apt_key.rb
+++ b/
lib/puppet/type/apt_key.rb
@@
-1,4
+1,5
@@
require 'pathname'
require 'pathname'
+require 'puppet/parameter/boolean'
Puppet::Type.newtype(:apt_key) do
@doc = <<-MANIFEST
Puppet::Type.newtype(:apt_key) do
@doc = <<-MANIFEST
@@
-22,6
+23,9
@@
Puppet::Type.newtype(:apt_key) do
ensurable
validate do
ensurable
validate do
+ if self[:refresh] == true && self[:ensure] == :absent
+ raise(_('ensure => absent and refresh => true are mutually exclusive'))
+ end
if self[:content] && self[:source]
raise(_('The properties content and source are mutually exclusive.'))
end
if self[:content] && self[:source]
raise(_('The properties content and source are mutually exclusive.'))
end
@@
-64,13
+68,18
@@
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'
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|h
kps|h
ttp|https)://)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$})
end
newparam(:options) do
desc 'Additional options to pass to apt-key\'s --keyserver-options.'
end
end
newparam(:options) do
desc 'Additional options to pass to apt-key\'s --keyserver-options.'
end
+ newparam(:refresh, boolean: true, parent: Puppet::Parameter::Boolean) do
+ desc 'When true, recreate an existing expired key'
+ defaultto false
+ end
+
newproperty(:fingerprint) do
desc <<-MANIFEST
The 40-digit hexadecimal fingerprint of the specified GPG key.
newproperty(:fingerprint) do
desc <<-MANIFEST
The 40-digit hexadecimal fingerprint of the specified GPG key.