From: Silvio Rhatto Date: Sat, 5 Mar 2016 22:06:32 +0000 (-0300) Subject: Support for config content and source params X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=0a60ba2e1da7114836e374a30d275cf8abf608fa;p=puppet-mpd.git Support for config content and source params --- 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, + } } }