From b9660cbe53341d4f21e46395140864a183e2ab5f Mon Sep 17 00:00:00 2001 From: Matthias Kneer Date: Sat, 14 Feb 2015 01:30:59 +0100 Subject: [PATCH 1/3] Added _netdev to default mount options to avoid mount failures when network is not yet ready --- manifests/mount.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/mount.pp b/manifests/mount.pp index 649a602..cfc976e 100644 --- a/manifests/mount.pp +++ b/manifests/mount.pp @@ -9,7 +9,7 @@ # define glusterfs::mount ( $device, - $options = 'defaults', + $options = 'defaults,_netdev', $ensure = 'mounted' ) { From 7cd9a0b0a4885ada69056c25c680345c771c361e Mon Sep 17 00:00:00 2001 From: Matthias Kneer Date: Wed, 25 Mar 2015 23:27:44 +0100 Subject: [PATCH 2/3] Added the possibility to change the fstype if required to *nfs'. Default is 'glusterfs'. --- README.md | 1 + manifests/mount.pp | 27 ++++++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8a430dd..bff7c11 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ on the same hardware for optimal performance and optimal fail-over : file { '/var/www': ensure => directory } glusterfs::mount { '/var/www': + fstype => 'glusterfs', device => $::hostname ? { 'client1' => '192.168.0.1:/gv0', 'client2' => '192.168.0.2:/gv0', diff --git a/manifests/mount.pp b/manifests/mount.pp index cfc976e..2bb123c 100644 --- a/manifests/mount.pp +++ b/manifests/mount.pp @@ -10,18 +10,31 @@ define glusterfs::mount ( $device, $options = 'defaults,_netdev', + $fstype = 'glusterfs', $ensure = 'mounted' ) { include glusterfs::client - mount { $title: - ensure => $ensure, - device => $device, - fstype => 'glusterfs', - options => $options, - require => Package['glusterfs-fuse'], + if $fstype == 'glusterfs' { + mount { $title: + ensure => $ensure, + device => $device, + fstype => $fstype, + options => $options, + require => Package['glusterfs-fuse'], + } + } + elseif $fstype == 'nfs' { + mount { $title: + ensure => $ensure, + device => $device, + fstype => $fstype, + options => $options, + } + } + else { + fail("$fstype is not a valid filesystem for gluster") } - } From e5fcaab035b1c126e16bd193235c71c86e1ab530 Mon Sep 17 00:00:00 2001 From: Matthias Kneer Date: Thu, 26 Mar 2015 00:20:18 +0100 Subject: [PATCH 3/3] Fixed stupid typo --- manifests/mount.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/mount.pp b/manifests/mount.pp index 2bb123c..abf361b 100644 --- a/manifests/mount.pp +++ b/manifests/mount.pp @@ -25,7 +25,7 @@ require => Package['glusterfs-fuse'], } } - elseif $fstype == 'nfs' { + elsif $fstype == 'nfs' { mount { $title: ensure => $ensure, device => $device,