aboutsummaryrefslogtreecommitdiff
path: root/manifests/sources_list.pp
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-02-14 14:11:19 -0200
committerSilvio Rhatto <rhatto@riseup.net>2011-02-14 14:11:19 -0200
commit1203852923594064e61fcfa0e4bf35f72000175d (patch)
treea2e24e5555da35cef04a6929a7669663d60c1311 /manifests/sources_list.pp
parentb9d11f17fff581fc854823e22a50539fc9e6ace3 (diff)
parent045e1fc748c83b55ce03c5cb2aa0a8ae29904975 (diff)
downloadpuppet-apt-1203852923594064e61fcfa0e4bf35f72000175d.tar.gz
puppet-apt-1203852923594064e61fcfa0e4bf35f72000175d.tar.bz2
Merge branch 'master' of git://labs.riseup.net/shared-apt
Conflicts: manifests/init.pp templates/sources.list.backports.erb
Diffstat (limited to 'manifests/sources_list.pp')
-rw-r--r--manifests/sources_list.pp30
1 files changed, 30 insertions, 0 deletions
diff --git a/manifests/sources_list.pp b/manifests/sources_list.pp
new file mode 100644
index 0000000..86b35a7
--- /dev/null
+++ b/manifests/sources_list.pp
@@ -0,0 +1,30 @@
+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,
+ owner => root, group => 0, mode => 0644;
+ }
+
+ if $source {
+ File["/etc/apt/sources.list.d/${name}"] {
+ source => $source,
+ }
+ }
+ else {
+ File["/etc/apt/sources.list.d/${name}"] {
+ content => $content,
+ }
+ }
+}
+