aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-08-23 16:42:58 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-08-23 16:42:58 -0300
commit5d0ae44bc45d00e351204bbd7f2a95dfaec1e0ea (patch)
tree88e07d0bc73bf7a6a48854fa3153d9182b9688c8
parent122d4b35bb7546c2b77a8fc4ece3e27f4c525c84 (diff)
downloadpuppet-nodo-5d0ae44bc45d00e351204bbd7f2a95dfaec1e0ea.tar.gz
puppet-nodo-5d0ae44bc45d00e351204bbd7f2a95dfaec1e0ea.tar.bz2
Introducing 'nodo::subsystem::media::folders::base'
-rw-r--r--manifests/nas/share.pp2
-rw-r--r--manifests/subsystem/media/folders.pp7
2 files changed, 5 insertions, 4 deletions
diff --git a/manifests/nas/share.pp b/manifests/nas/share.pp
index 6a0d6d3..4472286 100644
--- a/manifests/nas/share.pp
+++ b/manifests/nas/share.pp
@@ -79,7 +79,7 @@ define nodo::nas::share(
}
# Make sure basic media exist, no matter which disk is attached
- $cache = hiera('nodo::subsystem::media::folders::cache', '')
+ $cache = hiera('nodo::subsystem::media::folders::base', '/var/cache/media')
if $cache != '' {
file { [ "${cache}/${name}" ]:
diff --git a/manifests/subsystem/media/folders.pp b/manifests/subsystem/media/folders.pp
index 3f812e7..11d2f26 100644
--- a/manifests/subsystem/media/folders.pp
+++ b/manifests/subsystem/media/folders.pp
@@ -1,4 +1,5 @@
class nodo::subsystem::media::folders(
+ $base = hiera('nodo::subsystem::media::folders::base', '/var/cache/media'),
$cache = hiera('nodo::subsystem::media::folders::cache', directory),
$owner = hiera('nodo::subsystem::media::folders::owner', false),
$group = hiera('nodo::subsystem::media::folders::group', false)
@@ -10,7 +11,7 @@ class nodo::subsystem::media::folders(
}
# Media cache
- file { "/var/cache/media":
+ file { "$base":
ensure => $cache,
mode => 0755,
owner => $owner ? {
@@ -25,7 +26,7 @@ class nodo::subsystem::media::folders(
# Data folder is a cache
file { "/var/data":
- ensure => "/var/cache/media",
+ ensure => "$base",
}
# Hostname cache for general use
@@ -37,6 +38,6 @@ class nodo::subsystem::media::folders(
# Link to the media cache, useful to have unique remotes
# for git-annex in removable media
file { "/var/cache/${::hostname}/media":
- ensure => "/var/cache/media",
+ ensure => "$base",
}
}