summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-03-05 19:06:32 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-03-05 19:06:32 -0300
commit0a60ba2e1da7114836e374a30d275cf8abf608fa (patch)
treef78f70c0a9f7e4b1fb41a51cff1fff510f4ca85d
parent8d13dd4288478a0dcb06c46352f63f9487607f73 (diff)
downloadpuppet-mpd-0a60ba2e1da7114836e374a30d275cf8abf608fa.tar.gz
puppet-mpd-0a60ba2e1da7114836e374a30d275cf8abf608fa.tar.bz2
Support for config content and source params
-rw-r--r--manifests/init.pp18
1 files changed, 15 insertions, 3 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index a0a7268..55adfd2 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,4 +1,8 @@
-class mpd {
+class mpd(
+ $config_content = false,
+ $config_source = [ "puppet:///modules/site_mpd/${::hostname}.conf",
+ "puppet:///modules/mpd/mpd.conf" ],
+) {
package { 'mpd':
ensure => installed,
}
@@ -17,7 +21,15 @@ class mpd {
group => audio,
mode => 0640,
notify => Service['mpd'],
- source => [ "puppet:///modules/site_mpd/$hostname.conf",
- "puppet:///modules/mpd/mpd.conf" ],
+ }
+
+ if $config_content {
+ File['/etc/mpd.conf']{
+ content => $config_content,
+ }
+ } else {
+ File['/etc/mpd.conf']{
+ source => $config_source,
+ }
}
}