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
(maint) - Minor logic changes related to apt_key refresh param
[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 4a9b241bd48fdf5604de1edae942a69f20128531..72f56fa1c3708a6afc927693a4a05d66f9bf65ef 100644
(file)
--- a/
lib/puppet/type/apt_key.rb
+++ b/
lib/puppet/type/apt_key.rb
@@
-1,24
+1,31
@@
require 'pathname'
require 'pathname'
+require 'puppet/parameter/boolean'
Puppet::Type.newtype(:apt_key) do
@doc = <<-MANIFEST
Puppet::Type.newtype(:apt_key) do
@doc = <<-MANIFEST
- This type provides Puppet with the capabilities to manage GPG keys needed
- by apt to perform package validation. Apt has it's own GPG keyring that can
- be manipulated through the `apt-key` command.
+
@summary
This type provides Puppet with the capabilities to manage GPG keys needed
+
by apt to perform package validation. Apt has it's own GPG keyring that can
+
be manipulated through the `apt-key` command.
- apt_key { '6F6B15509CF8E59E6E469F327F438280EF8D349F':
- source => 'http://apt.puppetlabs.com/pubkey.gpg'
- }
+ @example Basic usage
+ apt_key { '6F6B15509CF8E59E6E469F327F438280EF8D349F':
+ source => 'http://apt.puppetlabs.com/pubkey.gpg'
+ }
- **Autorequires**
:
+ **Autorequires**
If Puppet is given the location of a key file which looks like an absolute
path this type will autorequire that file.
If Puppet is given the location of a key file which looks like an absolute
path this type will autorequire that file.
+
+ @api private
MANIFEST
ensurable
validate do
MANIFEST
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
@@
-68,6
+75,11
@@
Puppet::Type.newtype(:apt_key) do
desc 'Additional options to pass to apt-key\'s --keyserver-options.'
end
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.