]> gitweb.fluxo.info Git - puppet-mpd.git/commitdiff
Adds mpd::maintenance
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 19 May 2016 17:50:00 +0000 (14:50 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 19 May 2016 17:50:00 +0000 (14:50 -0300)
manifests/client.pp
manifests/client/base.pp [new file with mode: 0644]
manifests/maintenance.pp [new file with mode: 0644]

index 4d9f7bd6b672f05ff50c6a6dff817c3ebc7f6229..a603f69dc95cc3e8b1e32732a8394d444f223f0a 100644 (file)
@@ -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 (file)
index 0000000..6d4ab13
--- /dev/null
@@ -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 (file)
index 0000000..09b41f0
--- /dev/null
@@ -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,
+    },
+  }
+}