coren has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/115671

Change subject: labs_lvm class tweaks
......................................................................

labs_lvm class tweaks

Change-Id: I032257bb39e16bcaec31a7cf29fe9898a2807638
---
M manifests/role/labstest.pp
M modules/labs_lvm/manifests/volume.pp
2 files changed, 17 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/71/115671/1

diff --git a/manifests/role/labstest.pp b/manifests/role/labstest.pp
index ef0691f..be67f5c 100644
--- a/manifests/role/labstest.pp
+++ b/manifests/role/labstest.pp
@@ -9,7 +9,7 @@
         device => '/dev/vda'
     }
 
-    class { 'labs_lvm::volume':
+    labs_lvm::volume { 'store':
         mountpoint => '/mnt'
     }
 
diff --git a/modules/labs_lvm/manifests/volume.pp 
b/modules/labs_lvm/manifests/volume.pp
index 44ac968..cb95bb1 100644
--- a/modules/labs_lvm/manifests/volume.pp
+++ b/modules/labs_lvm/manifests/volume.pp
@@ -1,8 +1,6 @@
-# Class: labs_lvm
+# resource: labs_lvm::volume
 #
-# Manages LVM in labs instance for extra storage.  labs_lvm
-# only ensures the volume group exists, creating (and mounting)
-# actual logical volumes is done with labs_lvm::volume.
+# TODO: document
 #
 # Parameters:
 #
@@ -13,9 +11,9 @@
 # Sample Usage:
 #
 
-class labs_lvm::volume(
-    $name       = 'store',
-    $mountpoint = '/mnt',
+define labs_lvm::volume(
+    $name       = $title,
+    $mountpoint = "/mnt/$title",
     $size       = '100%FREE',
     $fstype     = 'ext4',
     $mkfs_opt   = ''
@@ -39,13 +37,23 @@
         command     => "/usr/local/sbin/make-instance-vol '$name' '$size' 
'$fstype' $mkfs_opt",
     }
 
+    file { $mountpoint:
+        ensure      => directory,
+        owner       => 'root',
+        group       => 'root',
+        mode        => 0555,
+    }
+
     mount { $mountpoint:
         ensure      => mounted,
         atboot      => false,
         device      => "/dev/mapper/vd-$name",
         options     => "defaults,noauto",
         fstype      => $fstype,
-        requires    => Exec["create-vd-$name"],
+        requires    => [
+                         Exec["create-vd-$name"],
+                         File[$mountpoint],
+                       ],
     }
 
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/115671
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I032257bb39e16bcaec31a7cf29fe9898a2807638
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: coren <mpellet...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to