aboutsummaryrefslogtreecommitdiff
path: root/manifests/apt_conf_snippet.pp
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2010-11-21 16:24:57 +0100
committerintrigeri <intrigeri@boum.org>2010-11-21 16:24:57 +0100
commitee6d13d1e42acca7374aa302a4f9dfa9001d799f (patch)
treef7d45d0a313a9fd5794ed11ee47418f53fb07047 /manifests/apt_conf_snippet.pp
parent06a2957f9f0c2b4060709150afa194b98c6995ba (diff)
parentac76a5d52df78aec919f08334ca5b140902a9298 (diff)
downloadpuppet-apt-ee6d13d1e42acca7374aa302a4f9dfa9001d799f.tar.gz
puppet-apt-ee6d13d1e42acca7374aa302a4f9dfa9001d799f.tar.bz2
Merge commit 'ac76a5d52df78aec919f08334ca5b140902a9298'
(Starting to merge changes from immerda.) Conflicts: manifests/default_sources_list.pp manifests/init.pp
Diffstat (limited to 'manifests/apt_conf_snippet.pp')
-rw-r--r--manifests/apt_conf_snippet.pp29
1 files changed, 29 insertions, 0 deletions
diff --git a/manifests/apt_conf_snippet.pp b/manifests/apt_conf_snippet.pp
new file mode 100644
index 0000000..77b88ae
--- /dev/null
+++ b/manifests/apt_conf_snippet.pp
@@ -0,0 +1,29 @@
+define apt::apt_conf_snippet(
+ $ensure = 'present',
+ $source = '',
+ $content = undef
+){
+ if $source == '' and $content == undef {
+ fail("One of \$source or \$content must be specified for apt_conf_snippet ${name}")
+ }
+ if $source != '' and $content != undef {
+ fail("Only one of \$source or \$content must specified for apt_conf_snippet ${name}")
+ }
+
+ if $source {
+ file { "/etc/apt/apt.conf.d/${name}":
+ ensure => $ensure,
+ source => $source,
+ notify => Exec["refresh_apt"],
+ owner => root, group => 0, mode => 0600;
+ }
+ }
+ else {
+ file { "/etc/apt/apt.conf.d/${name}":
+ ensure => $ensure,
+ content => $content,
+ notify => Exec["refresh_apt"],
+ owner => root, group => 0, mode => 0600;
+ }
+ }
+}