diff options
| author | James Shubin <james@shubin.ca> | 2014-01-21 05:02:58 -0500 |
|---|---|---|
| committer | James Shubin <james@shubin.ca> | 2014-01-21 10:46:34 -0500 |
| commit | 51fea724f4b606326489636a0ffb7e9673600f9b (patch) | |
| tree | 5d9fc128b49fc08316b72416c6b36fc7d8e9ab98 /manifests/mount | |
| parent | bee4993d4304730da27424dbdc73819b99d8ab5b (diff) | |
| download | puppet-gluster-51fea724f4b606326489636a0ffb7e9673600f9b.tar.gz puppet-gluster-51fea724f4b606326489636a0ffb7e9673600f9b.tar.xz puppet-gluster-51fea724f4b606326489636a0ffb7e9673600f9b.zip | |
Add client mounting and associated magic.
* Rename gluster::client to gluster::mount
* Add support to gluster::mount
* Add client machines and mounts to vagrant setup
* Fixed version interface for gluster::mount and gluster::server
* Improved firewall support for gluster::mount
* Update examples to use gluster::mount instead of gluster::client
* Update documentation
* Other small fixes
Diffstat (limited to 'manifests/mount')
| -rw-r--r-- | manifests/mount/base.pp | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/manifests/mount/base.pp b/manifests/mount/base.pp new file mode 100644 index 0000000..441ebe5 --- /dev/null +++ b/manifests/mount/base.pp @@ -0,0 +1,79 @@ +# 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::mount::base( + $repo = true, # add a repo automatically? true or false + $version = '' # pick a specific version (defaults to latest) +) { + include gluster::vardir + #$vardir = $::gluster::vardir::module_vardir # with trailing slash + $vardir = regsubst($::gluster::vardir::module_vardir, '\/$', '') + + # if we use ::mount and ::server on the same machine, this could clash, + # so we use the ensure_resource function to allow identical duplicates! + $rname = "${version}" ? { + '' => 'gluster', + default => "gluster-${version}", + } + if $repo { + $params = { + 'version' => "${version}", + } + ensure_resource('gluster::repo', "${rname}", $params) + } + + package { ['glusterfs', 'glusterfs-fuse']: + ensure => "${version}" ? { + '' => present, + default => "${version}", + }, + require => $repo ? { + false => undef, + default => Gluster::Repo["${rname}"], + }, + } + + # FIXME: choose a reliable and correct way to ensure fuse is loaded + # dmesg | grep -i fuse + # modprobe fuse + # dmesg | grep -i fuse + #fuse init (API version 7.13) + # + + # modprobe fuse if it's missing + exec { '/sbin/modprobe fuse': + logoutput => on_failure, + onlyif => '/usr/bin/test -z "`/bin/dmesg | /bin/grep -i fuse`"', + alias => 'gluster-fuse', + } + #exec { '/sbin/modprobe fuse': + # logoutput => on_failure, + # unless => "/sbin/lsmod | /bin/grep -q '^fuse'", + # alias => 'gluster-modprobe-fuse', + #} + + # TODO: will this autoload the fuse module? + #file { '/etc/modprobe.d/fuse.conf': + # content => "fuse\n", # TODO: "install fuse /sbin/modprobe --ignore-install fuse ; /bin/true\n" ? + # owner => root, + # group => root, + # mode => 644, # u=rw,go=r + # ensure => present, + #} +} + +# vim: ts=8 |
