From 89a77fc8a4f8a4877ac19e81cbab2c03a7bb1626 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 29 Mar 2013 18:22:57 -0300 Subject: Initial import --- manifests/init.pp | 19 +++++++++++++++++++ manifests/share.pp | 15 +++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 manifests/init.pp create mode 100644 manifests/share.pp (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..dd3b62d --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,19 @@ +class minidlna { + package { "minidlna": } -> + service { "minidlna": } + + $conf = "/etc/minidlna.conf" + concat { $conf: + owner => root, + group => root, + require => Package[minidlna], + notify => Service[minidlna], + } + + concat::fragment { "${conf}_header": + target => $conf, + content => template("minidlna/minidlna.conf.erb"), + order => 1, + } + +} diff --git a/manifests/share.pp b/manifests/share.pp new file mode 100644 index 0000000..d1dca65 --- /dev/null +++ b/manifests/share.pp @@ -0,0 +1,15 @@ +define minidlna::share($type = undef) { + + $def = $type ? { + undef => $title, + default => "${type},${title}", + } + + $conf = "/etc/minidlna.conf" + concat::fragment { "${conf}_${title}": + target => $conf, + content => "media_dir=${def}\n", + order => 50, + } + +} -- cgit v1.2.3