module-apt/manifests/sources_list.pp
Gabriel Filion 27d5808299 rename things for easier understanding
remove the use of _snippet in names (except for preferences_snippet) so
that they represent directly a resource name.

rename custom_sources_template to sources_list.

modify sources_list to make it more flexible (gives the opportunity to
provide sources or content). this changes its behaviour in that the name
is now the name of the file in sources.list.d

rename proxy-client to proxy_client to use the same standard for its
name as the other classes.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-25 01:44:04 -04:00

30 lines
711 B
Puppet

define apt::sources_list (
$ensure = 'present',
$source = '',
$content = undef
) {
if $source == '' and $content == undef {
fail("One of \$source or \$content must be specified for apt_sources_snippet ${name}")
}
if $source != '' and $content != undef {
fail("Only one of \$source or \$content must specified for apt_sources_snippet ${name}")
}
file { "/etc/apt/sources.list.d/${name}":
ensure => $ensure,
notify => Exec['refresh_apt'],
owner => root, group => 0, mode => 0600;
}
if $source {
File["/etc/apt/sources.list.d/${name}"] {
source => $source,
}
}
else {
File["/etc/apt/sources.list.d/${name}"] {
content => $content,
}
}
}