From bf64d77d729383bd8fd4a5a779cc86dc7ec8a61b Mon Sep 17 00:00:00 2001 From: Vincent Deygas Date: Tue, 20 Jan 2015 09:48:44 +0000 Subject: Allowed to use 'glusterfs' or 'ntfs' as fstype for gluster::mount Depending of gluster use, performances could be very impacted by this choice. See http://www.gluster.org/community/documentation/index.php/Gluster_3.2:_Using_NFS_with_Gluster --- manifests/mount.pp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/manifests/mount.pp b/manifests/mount.pp index 2e842b1..db437a3 100644 --- a/manifests/mount.pp +++ b/manifests/mount.pp @@ -24,8 +24,9 @@ define gluster::mount( # defs, but not actually mount (testing) $repo = true, # add a repo automatically? true or false $version = '', # pick a specific version (defaults to latest) - $ip = '', # you can specify which ip address to use (if multiple) - $shorewall = false + $ip = '', # you can specify which ip address to use (if multiple) + $type = 'glusterfs', # use 'glusterfs' or 'nfs' + $shorewall = false, ) { include gluster::params @@ -77,6 +78,7 @@ define gluster::mount( fail('No valid IP exists!') } + # TODO: review shorewall rules against nfs fstype mount option if $shorewall { $safename = regsubst("${name}", '/', '_', 'G') # make /'s safe @@shorewall::rule { "glusterd-management-${fqdn}-${safename}": @@ -142,6 +144,7 @@ define gluster::mount( alias => "${short_name}", # don't allow duplicates name's } + # TODO: review packages content against nfs fstype mount option $packages = "${::gluster::params::package_glusterfs_fuse}" ? { '' => ["${::gluster::params::package_glusterfs}"], default => [ @@ -149,6 +152,12 @@ define gluster::mount( "${::gluster::params::package_glusterfs_fuse}", ], } + + $valid_type = "${type}" ? { + 'nfs' => 'nfs', + default => 'glusterfs', + } + # Mount Options: # * backupvolfile-server=server-name # * fetch-attempts=N (where N is number of attempts) @@ -165,13 +174,13 @@ define gluster::mount( atboot => true, ensure => $mounted_bool, device => "${server}", - fstype => 'glusterfs', + fstype => "${valid_type}", options => "defaults,_netdev,${rw_bool}", # TODO: will $suid_bool work with gluster ? dump => '0', # fs_freq: 0 to skip file system dumps pass => '0', # fs_passno: 0 to skip fsck on boot require => [ Package[$packages], - File["${long_name}"], # the mountpoint + File["${long_name}"], # the mountpoint Exec['gluster-fuse'], # ensure fuse is loaded! ], } -- cgit