make it optional to end sources in ".list"

This commit is contained in:
Gabriel Filion 2014-12-06 00:52:59 -05:00
parent 5a8d214529
commit 7c68c19973

View file

@ -15,22 +15,24 @@ define apt::sources_list (
include apt::dot_d_directories include apt::dot_d_directories
$realname = regsubst($name, '\.list$', '')
# One would expect the 'file' resource on sources.list.d to trigger an # 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 # apt-get update when files are added or modified in the directory, but it
# apparently doesn't. # apparently doesn't.
file { "/etc/apt/sources.list.d/${name}": file { "/etc/apt/sources.list.d/${realname}.list":
ensure => $ensure, ensure => $ensure,
owner => root, group => 0, mode => '0644', owner => root, group => 0, mode => '0644',
notify => Exec['refresh_apt'], notify => Exec['refresh_apt'],
} }
if $source { if $source {
File["/etc/apt/sources.list.d/${name}"] { File["/etc/apt/sources.list.d/${realname}.list"] {
source => $source, source => $source,
} }
} }
else { else {
File["/etc/apt/sources.list.d/${name}"] { File["/etc/apt/sources.list.d/${realname}.list"] {
content => $content, content => $content,
} }
} }