aboutsummaryrefslogtreecommitdiff
path: root/manifests/key.pp
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2015-08-31 10:00:09 +0000
committerintrigeri <intrigeri@boum.org>2015-08-31 10:01:03 +0000
commit5f7232b420e02eaa38c14a7be75034d9b3cdd64b (patch)
treead179382d82d8f15174b2ebad1cd6f3c1c35bef7 /manifests/key.pp
parent8745de17d64a6eac0eb9f15c19f990fd80383c1f (diff)
downloadpuppet-apt-5f7232b420e02eaa38c14a7be75034d9b3cdd64b.tar.gz
puppet-apt-5f7232b420e02eaa38c14a7be75034d9b3cdd64b.tar.bz2
Add validation for apt::key's name.
It's great to document requirements in README, but error'ing out whenever the user messes up is even better IMO.
Diffstat (limited to 'manifests/key.pp')
-rw-r--r--manifests/key.pp5
1 files changed, 5 insertions, 0 deletions
diff --git a/manifests/key.pp b/manifests/key.pp
index 7be526e..65b62e9 100644
--- a/manifests/key.pp
+++ b/manifests/key.pp
@@ -1,4 +1,9 @@
define apt::key ($source, $ensure = 'present') {
+ validate_re(
+ $name, '\.gpg$',
+ 'An apt::key resource name must have the .gpg extension',
+ )
+
file {
"/etc/apt/trusted.gpg.d/${name}":
ensure => $ensure,