projects
/
mirror
/
dsa-puppet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3ae1d19
)
Revert "this is supposed to work" - it seems it doesn't
author
Stephen Gran
<steve@lobefin.net>
Mon, 16 Apr 2012 14:47:48 +0000
(15:47 +0100)
committer
Stephen Gran
<steve@lobefin.net>
Mon, 16 Apr 2012 14:47:48 +0000
(15:47 +0100)
This reverts commit
3ae1d19e3d1e64321475bceed121a37522dd8226
.
modules/site/manifests/aptrepo.pp
patch
|
blob
|
history
diff --git
a/modules/site/manifests/aptrepo.pp
b/modules/site/manifests/aptrepo.pp
index
cea4281
..
ae66d6f
100644
(file)
--- a/
modules/site/manifests/aptrepo.pp
+++ b/
modules/site/manifests/aptrepo.pp
@@
-1,5
+1,6
@@
define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config = undef, $ensure = present) {
define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config = undef, $ensure = present) {
+
case $ensure {
present: {
if $key {
case $ensure {
present: {
if $key {
@@
-31,7
+32,7
@@
define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config =
}
} elsif $keyid {
exec { "apt-key-del-${keyid}":
}
} elsif $keyid {
exec { "apt-key-del-${keyid}":
- command => "apt-key del ${keyid}",
+ command
=> "apt-key del ${keyid}",
}
}
}
}
}
}
@@
-42,15
+43,19
@@
define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config =
if ! ($config or $template) {
fail ( "No configuration found for ${name}" )
}
if ! ($config or $template) {
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,
- notify => Exec['apt-get update'],
+ if $template {
+ file { "/etc/apt/sources.list.d/${name}.list":
+ ensure => $ensure,
+ content => template($template),
+ notify => Exec['apt-get update'],
+ }
+ } else {
+ file { "/etc/apt/sources.list.d/${name}.list":
+ ensure => $ensure,
+ source => $config,
+ notify => Exec['apt-get update'],
+ }
}
}
}
}