diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-03-05 19:06:32 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-03-05 19:06:32 -0300 |
commit | 0a60ba2e1da7114836e374a30d275cf8abf608fa (patch) | |
tree | f78f70c0a9f7e4b1fb41a51cff1fff510f4ca85d | |
parent | 8d13dd4288478a0dcb06c46352f63f9487607f73 (diff) | |
download | puppet-mpd-0a60ba2e1da7114836e374a30d275cf8abf608fa.tar.gz puppet-mpd-0a60ba2e1da7114836e374a30d275cf8abf608fa.tar.bz2 |
Support for config content and source params
-rw-r--r-- | manifests/init.pp | 18 |
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, + } } } |