aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Filion <gabster@lelutin.ca>2014-12-06 00:52:59 -0500
committerGabriel Filion <gabster@lelutin.ca>2014-12-06 00:52:59 -0500
commit7c68c19973518841ba2462371b9d4b4d4f1da37e (patch)
tree147128de8c1b7ac287e8fd511f25d906d308ee27
parent5a8d214529429b5dd898e0df29d69e0acf5271df (diff)
downloadpuppet-apt-7c68c19973518841ba2462371b9d4b4d4f1da37e.tar.gz
puppet-apt-7c68c19973518841ba2462371b9d4b4d4f1da37e.tar.bz2
make it optional to end sources in ".list"
-rw-r--r--manifests/sources_list.pp8
1 files changed, 5 insertions, 3 deletions
diff --git a/manifests/sources_list.pp b/manifests/sources_list.pp
index 3367f83..aefad2d 100644
--- a/manifests/sources_list.pp
+++ b/manifests/sources_list.pp
@@ -15,22 +15,24 @@ define apt::sources_list (
include apt::dot_d_directories
+ $realname = regsubst($name, '\.list$', '')
+
# One would expect the 'file' resource on sources.list.d to trigger an
# apt-get update when files are added or modified in the directory, but it
# apparently doesn't.
- file { "/etc/apt/sources.list.d/${name}":
+ file { "/etc/apt/sources.list.d/${realname}.list":
ensure => $ensure,
owner => root, group => 0, mode => '0644',
notify => Exec['refresh_apt'],
}
if $source {
- File["/etc/apt/sources.list.d/${name}"] {
+ File["/etc/apt/sources.list.d/${realname}.list"] {
source => $source,
}
}
else {
- File["/etc/apt/sources.list.d/${name}"] {
+ File["/etc/apt/sources.list.d/${realname}.list"] {
content => $content,
}
}