Filippo Giunchedi has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/374994 )

Change subject: WIP jbod config for cassandra
......................................................................

WIP jbod config for cassandra

Change-Id: I456261d7446ef131ebf6b9c292e8961816f0f5a8
---
M hieradata/hosts/restbase2001.yaml
M modules/cassandra/manifests/init.pp
A modules/cassandra/manifests/jbod_device.pp
3 files changed, 43 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/94/374994/1

diff --git a/hieradata/hosts/restbase2001.yaml 
b/hieradata/hosts/restbase2001.yaml
index 062634b..db38b13 100644
--- a/hieradata/hosts/restbase2001.yaml
+++ b/hieradata/hosts/restbase2001.yaml
@@ -1 +1,2 @@
 profile::cassandra::rack: 'b'
+cassandra::jbod_devices: ['sda', 'sdb', 'sdc', 'sdd', 'sde']
diff --git a/modules/cassandra/manifests/init.pp 
b/modules/cassandra/manifests/init.pp
index 1c40774..a168807 100644
--- a/modules/cassandra/manifests/init.pp
+++ b/modules/cassandra/manifests/init.pp
@@ -457,6 +457,9 @@
         }
     }
 
+    $jbod_devices = hiera('cassandra::jbod_devices', [])
+    cassandra::jbod_device { $jbod_devices: }
+
     # nodetool wrapper to handle multiple instances, for each instance there
     # will be symlinks from /usr/local/bin/nodetool-<INSTANCE_NAME> to
     # nodetool-instance
diff --git a/modules/cassandra/manifests/jbod_device.pp 
b/modules/cassandra/manifests/jbod_device.pp
new file mode 100644
index 0000000..4407e58
--- /dev/null
+++ b/modules/cassandra/manifests/jbod_device.pp
@@ -0,0 +1,39 @@
+# == Define: cassandra::jbod_device
+#
+# Configure a block device to be used for Cassandra JBOD.
+# Specifically, create the desired mount point directory and add an entry to
+# /etc/fstab.
+#
+# === Parameters
+#
+# [*mount_point*]
+#   The mount point to use
+#
+# [*mount_options*]
+#   What options to use for /etc/fstab
+
+define cassandra::jbod_device (
+  $mount_point = "/srv/${title}",
+  $mount_options = 'nofail,defaults',
+) {
+    $device = $title
+
+    file { "mountpoint-${mount_point}":
+        ensure => directory,
+        path   => $mount_point,
+        owner  => 'root',
+        group  => 'root',
+        mode   => '0750',
+        before => Mount[$mount_point],
+    }
+
+    mount { $mount_point:
+        ensure   => mounted,
+        device   => $device,
+        name     => $mount_point,
+        fstype   => 'ext4',
+        options  => $mount_options,
+        atboot   => true,
+        remounts => true,
+    }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I456261d7446ef131ebf6b9c292e8961816f0f5a8
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi <fgiunch...@wikimedia.org>

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

Reply via email to