diff options
author | intrigeri <intrigeri@boum.org> | 2015-08-31 10:00:09 +0000 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2015-08-31 10:01:03 +0000 |
commit | 5f7232b420e02eaa38c14a7be75034d9b3cdd64b (patch) | |
tree | ad179382d82d8f15174b2ebad1cd6f3c1c35bef7 | |
parent | 8745de17d64a6eac0eb9f15c19f990fd80383c1f (diff) | |
download | puppet-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.
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | manifests/key.pp | 5 |
2 files changed, 6 insertions, 0 deletions
@@ -99,6 +99,7 @@ This module needs: - the lsb module: git://labs.riseup.net/shared-lsb - the common module: git://labs.riseup.net/shared-common +- the stdlib module: https://forge.puppetlabs.com/puppetlabs/stdlib By default, on normal hosts, this module sets the configuration option DSelect::Clean to 'auto'. On virtual servers, the value is set by default to 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, |