X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=lib%2Fpuppet%2Ftype%2Fapt_key.rb;h=5150ee8ed29f3c3d2c0f8bd5e9be37f07c02487f;hb=9f2fd0cb6d191e7883a140fb160d8fefaa685a66;hp=4a9b241bd48fdf5604de1edae942a69f20128531;hpb=65904b214d98c899f390ac6908322fc06e3aca13;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/lib/puppet/type/apt_key.rb b/lib/puppet/type/apt_key.rb index 4a9b241..5150ee8 100644 --- a/lib/puppet/type/apt_key.rb +++ b/lib/puppet/type/apt_key.rb @@ -1,4 +1,5 @@ require 'pathname' +require 'puppet/parameter/boolean' Puppet::Type.newtype(:apt_key) do @doc = <<-MANIFEST @@ -6,19 +7,25 @@ Puppet::Type.newtype(:apt_key) do 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. + + @api private 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 @@ -68,6 +75,10 @@ Puppet::Type.newtype(:apt_key) 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' + end + newproperty(:fingerprint) do desc <<-MANIFEST The 40-digit hexadecimal fingerprint of the specified GPG key.