From 0a60ba2e1da7114836e374a30d275cf8abf608fa Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 5 Mar 2016 19:06:32 -0300 Subject: Support for config content and source params --- manifests/init.pp | 18 +++++++++++++++--- 1 file 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, + } } } -- cgit v1.2.3