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 649a602..abf361b 100644 --- a/manifests/mount.pp +++ b/manifests/mount.pp @@ -9,19 +9,32 @@ # define glusterfs::mount ( $device, - $options = 'defaults', + $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'], + } + } + elsif $fstype == 'nfs' { + mount { $title: + ensure => $ensure, + device => $device, + fstype => $fstype, + options => $options, + } + } + else { + fail("$fstype is not a valid filesystem for gluster") } - }