summaryrefslogtreecommitdiffstats
path: root/manifests
diff options
context:
space:
mode:
authorJames Shubin <james@shubin.ca>2014-05-06 11:50:41 -0400
committerJames Shubin <james@shubin.ca>2014-09-26 13:27:09 -0400
commit6c962083d8b100dcaeb6f11dbe61e6071f3d13f0 (patch)
treea7d7363ebc83ab9f5947ca3e42d5856b13edeb4c /manifests
parentb00516e42f5e7532700a719df8248b272b544030 (diff)
downloadpuppet-gluster-6c962083d8b100dcaeb6f11dbe61e6071f3d13f0.tar.gz
puppet-gluster-6c962083d8b100dcaeb6f11dbe61e6071f3d13f0.tar.xz
puppet-gluster-6c962083d8b100dcaeb6f11dbe61e6071f3d13f0.zip
Add btrfs support.
This patch adds btrfs support to puppet-gluster. This is not (yet) officially supported by GlusterFS but should work. It is being added here to make it easier to test with GlusterFS and report bugs. Special thanks to Eric Sandeen for adding --uuid support to mkfs.btrfs: https://bugzilla.redhat.com/show_bug.cgi?id=1094857 Tracker bug for this feature is: https://bugzilla.redhat.com/show_bug.cgi?id=1094860
Diffstat (limited to 'manifests')
-rw-r--r--manifests/brick.pp15
-rw-r--r--manifests/brick/btrfs.pp27
-rw-r--r--manifests/params.pp2
3 files changed, 44 insertions, 0 deletions
diff --git a/manifests/brick.pp b/manifests/brick.pp
index b280d8f..8358ad2 100644
--- a/manifests/brick.pp
+++ b/manifests/brick.pp
@@ -246,6 +246,7 @@ define gluster::brick(
},
default => $fstype ? {
'ext4' => 'ext4', # TODO
+ 'btrfs' => 'btrfs',
default => 'xfs',
},
}
@@ -351,6 +352,20 @@ define gluster::brick(
# mount options
$options_list = [] # TODO
+
+ } elsif ( $valid_fstype == 'btrfs' ) {
+ # exec requires
+ include gluster::brick::btrfs
+ $exec_requires = [Package["${::gluster::params::package_btrfsprogs}"]]
+
+ # FIXME: this filesystem has not yet been optimized for performance
+
+ # mkfs w/ uuid command
+ $mkfs_exec = "${::gluster::params::program_mkfs_btrfs} -U '${valid_fsuuid}' ${dev2}"
+
+ # mount options
+ $options_list = [] # TODO
+
} else {
fail('The $fstype is invalid.')
}
diff --git a/manifests/brick/btrfs.pp b/manifests/brick/btrfs.pp
new file mode 100644
index 0000000..94232b3
--- /dev/null
+++ b/manifests/brick/btrfs.pp
@@ -0,0 +1,27 @@
+# GlusterFS module by James
+# Copyright (C) 2010-2013+ James Shubin
+# Written by James Shubin <james@shubin.ca>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+class gluster::brick::btrfs {
+
+ include gluster::params
+
+ package { "${::gluster::params::package_btrfsprogs}":
+ ensure => present,
+ }
+}
+
+# vim: ts=8
diff --git a/manifests/params.pp b/manifests/params.pp
index b53b9e2..8ed265e 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -24,6 +24,7 @@ class gluster::params(
$package_e2fsprogs = 'e2fsprogs',
$package_xfsprogs = 'xfsprogs',
+ $package_btrfsprogs = 'btrfs-progs',
$package_python_argparse = 'python-argparse',
$package_python_lxml = 'python-lxml',
@@ -47,6 +48,7 @@ class gluster::params(
$program_xfsadmin = '/usr/sbin/xfs_admin',
$program_mkfs_xfs = '/sbin/mkfs.xfs',
$program_mkfs_ext4 = '/sbin/mkfs.ext4',
+ $program_mkfs_btrfs = '/sbin/mkfs.btrfs',
$program_fping = '/usr/sbin/fping',
$program_findmnt = '/bin/findmnt',