(#12823) Add apt::key defined type and modify apt::source to use it
authorReid Vandewiele <marut@cat.pdx.edu>
Fri, 24 Feb 2012 18:10:03 +0000 (10:10 -0800)
committerReid Vandewiele <marut@cat.pdx.edu>
Thu, 1 Mar 2012 22:15:52 +0000 (14:15 -0800)
commit8cdaf855a1d0dd24fed02fc3ee9941e0a1e6849b
tree306144be43b1f08974e953e38e19dc3e3d81e29d
parentb1eb28956ec025c200cfcef32eea6e696498e10e
(#12823) Add apt::key defined type and modify apt::source to use it

Adding this defined type allows puppet to add keys to the apt keystore without
needing to add a corresponding source; it also adds the "key_source" parameter
for wget'ing keys from arbitrary URLs, and allows for keys to be explicity
removed.

apt::key allows a key to be ensured present multiple times to account for
apt::source resources that all reference the same key. However, this means
that it is possible for a given key to be defined multiple times with
differing source parameters. e.g.

apt::key { "Add key: 4BD6EC30 from Apt::Source bunny":
  key        => "4BD6EC30",
  key_server => "pgp.mit.edu",
}

apt::key { "Add key: 4BD6EC30 from Apt::Source rabbit":
  key        => "4BD6EC30",
  key_server => "keyserver.ubuntu.com",
}

The defined type will accept both definitions and will create multiple exec
resources. This was deemed preferable to the alternative (creating only one
exec resource) in that one broken definition won't hose an entire catalog. If
one definition fails to install the key because of a bad "key_server", the
next apt::key that uses the key will get it done.
README.md
manifests/key.pp [new file with mode: 0644]
manifests/source.pp
spec/defines/key_spec.rb [new file with mode: 0644]
spec/defines/source_spec.rb