summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--DOCUMENTATION.md2
-rw-r--r--data/tree/RedHat/Fedora.yaml1
-rw-r--r--manifests/brick.pp15
-rw-r--r--manifests/brick/btrfs.pp27
-rw-r--r--manifests/params.pp2
-rw-r--r--puppet-gluster-documentation.pdfbin238523 -> 238689 bytes
-rw-r--r--vagrant/Vagrantfile10
-rw-r--r--vagrant/puppet/manifests/site.pp4
8 files changed, 61 insertions, 0 deletions
diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md
index b103868..e1cc82c 100644
--- a/DOCUMENTATION.md
+++ b/DOCUMENTATION.md
@@ -778,6 +778,8 @@ This should be _xfs_ or _ext4_. Using _xfs_ is recommended, but _ext4_ is also
quite common. This only affects a file system that is getting created by this
module. If you provision a new machine, with a root file system of _ext4_, and
the brick you create is a root file system path, then this option does nothing.
+A _btrfs_ option is now available for testing. It is not officially supported
+by GlusterFS, but testing it anyways, and reporting any issues is encouraged.
####`xfs_inode64`
Set _inode64_ mount option when using the _xfs_ fstype. Choose _true_ to set.
diff --git a/data/tree/RedHat/Fedora.yaml b/data/tree/RedHat/Fedora.yaml
index 856eebe..09a8789 100644
--- a/data/tree/RedHat/Fedora.yaml
+++ b/data/tree/RedHat/Fedora.yaml
@@ -14,6 +14,7 @@ gluster::params::program_vgdisplay: '/usr/sbin/vgdisplay'
#gluster::params::program_lvdisplay: '/usr/sbin/lvdisplay'
gluster::params::program_mkfs_xfs: '/usr/sbin/mkfs.xfs'
gluster::params::program_mkfs_ext4: '/usr/sbin/mkfs.ext4'
+gluster::params::program_mkfs_btrfs: '/usr/sbin/mkfs.btrfs'
gluster::params::program_findmnt: '/usr/bin/findmnt'
gluster::params::misc_gluster_reload: '/usr/bin/systemctl reload glusterd'
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',
diff --git a/puppet-gluster-documentation.pdf b/puppet-gluster-documentation.pdf
index f129b93..69ba9de 100644
--- a/puppet-gluster-documentation.pdf
+++ b/puppet-gluster-documentation.pdf
Binary files differ
diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile
index 44b36a0..aef25d1 100644
--- a/vagrant/Vagrantfile
+++ b/vagrant/Vagrantfile
@@ -67,6 +67,7 @@ netmask2 = IPAddr.new('255.255.255.255').mask(cidr2).to_s
count = 4 # default number of gluster hosts to build
disks = 0 # default number of disks to attach (after the host os)
bricks = 0 # default number of bricks to build (0 defaults to 1)
+fstype = '' # default filesystem for bricks (requires bricks > 0)
version = '' # default gluster version (empty string means latest!)
firewall = false # default firewall enabled (FIXME: default to true when keepalived bug is fixed)
replica = 1 # default replica count
@@ -88,6 +89,7 @@ if File.exist?(f)
count = settings[:count]
disks = settings[:disks]
bricks = settings[:bricks]
+ fstype = settings[:fstype]
version = settings[:version]
firewall = settings[:firewall]
replica = settings[:replica]
@@ -121,6 +123,12 @@ while skip < ARGV.length
bricks = v.to_i # set gluster brick count
+ elsif ARGV[skip].start_with?(arg='--gluster-fstype=')
+ v = ARGV.delete_at(skip).dup
+ v.slice! arg
+
+ fstype = v.to_s # set gluster fstype
+
elsif ARGV[skip].start_with?(arg='--gluster-version=')
v = ARGV.delete_at(skip).dup
v.slice! arg
@@ -189,6 +197,7 @@ settings = {
:count => count,
:disks => disks,
:bricks => bricks,
+ :fstype => fstype,
:version => version,
:firewall => firewall,
:replica => replica,
@@ -460,6 +469,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
'vagrant' => '1',
'vagrant_gluster_disks' => disks.to_s,
'vagrant_gluster_bricks' => bricks.to_s,
+ 'vagrant_gluster_fstype' => fstype.to_s,
'vagrant_gluster_replica' => replica.to_s,
'vagrant_gluster_layout' => layout,
'vagrant_gluster_setgroup' => setgroup,
diff --git a/vagrant/puppet/manifests/site.pp b/vagrant/puppet/manifests/site.pp
index 426099d..e0decc3 100644
--- a/vagrant/puppet/manifests/site.pp
+++ b/vagrant/puppet/manifests/site.pp
@@ -69,6 +69,10 @@ node /^annex\d+$/ inherits default { # annex{1,2,..N}
$brick_param_defaults = {
# TODO: set these from vagrant variables...
'lvm' => false,
+ 'fstype' => "${::vagrant_gluster_fstype}" ? {
+ '' => undef,
+ default => "${::vagrant_gluster_fstype}",
+ },
'xfs_inode64' => true,
'force' => true,
}