From 92bec1c3d6c8c3336ec1d98298498f499834948b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 19 May 2016 14:50:00 -0300 Subject: Adds mpd::maintenance --- manifests/client.pp | 4 ++-- manifests/client/base.pp | 5 +++++ manifests/maintenance.pp | 13 +++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 manifests/client/base.pp create mode 100644 manifests/maintenance.pp diff --git a/manifests/client.pp b/manifests/client.pp index 4d9f7bd..a603f69 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -1,5 +1,5 @@ -class mpd::client { - package { [ 'mpc', 'ncmpcpp' ]: +class mpd::client inherits mpd::client::base { + package { 'ncmpcpp': ensure => installed, } diff --git a/manifests/client/base.pp b/manifests/client/base.pp new file mode 100644 index 0000000..6d4ab13 --- /dev/null +++ b/manifests/client/base.pp @@ -0,0 +1,5 @@ +class mpd::client::base { + package { 'mpc': + ensure => present, + } +} diff --git a/manifests/maintenance.pp b/manifests/maintenance.pp new file mode 100644 index 0000000..09b41f0 --- /dev/null +++ b/manifests/maintenance.pp @@ -0,0 +1,13 @@ +class mpd::maintenance inherits mpc::client::base { + $password = hiera('mpd::maintenance::password', '') + + cron { "db_update": + environment => "MPD_HOST=${password}@localhost" + command => "/usr/bin/mpc update", + user => "root", + ensure => $password ? { + '' => present, + default => absent, + }, + } +} -- cgit v1.2.3