27d5808299
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>
29 lines
670 B
Puppet
29 lines
670 B
Puppet
define apt::apt_conf(
|
|
$ensure = 'present',
|
|
$source = '',
|
|
$content = undef
|
|
){
|
|
if $source == '' and $content == undef {
|
|
fail("One of \$source or \$content must be specified for apt_conf ${name}")
|
|
}
|
|
if $source != '' and $content != undef {
|
|
fail("Only one of \$source or \$content must specified for apt_conf ${name}")
|
|
}
|
|
|
|
file { "/etc/apt/apt.conf.d/${name}":
|
|
ensure => $ensure,
|
|
notify => Exec["refresh_apt"],
|
|
owner => root, group => 0, mode => 0600;
|
|
}
|
|
|
|
if $source {
|
|
File["/etc/apt/apt.conf.d/${name}"] {
|
|
source => $source,
|
|
}
|
|
}
|
|
else {
|
|
File["/etc/apt/apt.conf.d/${name}"] {
|
|
content => $content,
|
|
}
|
|
}
|
|
}
|