-define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config = undef, $ensure = present) {
+define site::aptrepo ($key = undef, $keyid = undef, $content = '', $source = '', $ensure = present) {
case $ensure {
present: {
}
} elsif $keyid {
exec { "apt-key-del-${keyid}":
- command => "apt-key del ${keyid}",
+ command => "apt-key del ${keyid}",
}
}
}
}
if $ensure == present {
- if ! ($config or $template) {
+ if ! ($source or $content) {
fail ( "No configuration found for ${name}" )
}
- if ($config and $template) {
- fail ( "Can't specify both config and template for ${name}" )
- }
}
file { "/etc/apt/sources.list.d/${name}.list":
ensure => $ensure,
- content => template($template),
- source => $config,
+ content => $content,
+ source => $source,
notify => Exec['apt-get update'],
}
}