Version information
This version is compatible with:
- Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x
- Puppet >= 6.1.0 < 8.0.0
- Archlinux, , , ,
Start using this module
Add this module to your Puppetfile:
mod 'puppet-gluster', '6.0.0'
Learn more about managing modules with a PuppetfileDocumentation
Gluster module for Puppet
Moved to Vox Pupuli
This module has been moved to the Vox Pupuli organization. Please update all bookmarks and Puppetfile references.
Table of Contents
Overview
This module installs and configures servers to participate in a Gluster Trusted Storage Pool, create or modify one or more Gluster volumes, and mount Gluster volumes.
Also provided with this module are a number of custom Gluster-related facts.
Custom Facts
gluster_binary
: the full pathname of the Gluster CLI commandgluster_peer_count
: the number of peers to which this server is connected in the pool.gluster_peer_list
: a comma-separated list of peer hostnamesgluster_volume_list
: a comma-separated list of volumes being served by this servergluster_volume_#{vol}_bricks
: a comma-separated list of bricks in each volume being served by this servergluster_volume_#{vol}_options
: a comma-separared list of options enabled on each volumegluster_volume_#{vol}_ports
: a comma-separated list of ports used by the bricks in the specified volume.
The gluster_binary
fact will look for an external fact named gluster_custom_binary
. If this fact is defined, gluster_binary
will use that value. Otherwise the path will be searched until the gluster command is found.
Classes
params.pp
This class establishes a number of default values used by the other classes.
You should not need to include or reference this class directly.
repo.pp
This class enables the GlusterFS repository. Either Gluster.org for APT or CentOS managed YUM for EL.
Fedora users can get GlusterFS packages directly from Fedora's repository. Red Hat users with a Gluster Storage subscription should set the appropriate subscription/repo for their OS. Therefore for both Fedora and Red Hat Gluster Storage users, the default upstream community repo should be off:
gluster::repo => false
For systems using APT, the latest packages of the latest release will be installed by default. Otherwise, specify a version:
class { ::gluster::repo:
version => '3.5.2',
}
For systems using YUM, the latest package from the 3.8 release branch will be installed. You can specify a specific version and release:
class { ::gluster::repo:
release => '3.7',
}
class { ::gluster:
version => '3.7.12',
}
Package priorities are supported, but not activated by default.
Yum: If a priority
parameter is passed to this class, the yum-plugin-priorities
package will be installed, and a priority will be set on the Gluster repository.
Apt: If a priority
parameter is passed to this class, it will be passed as is to the Apt::Source resource. See Puppetlabs apt module for details.
This is useful in the event that you want to install a version from the upstream repos that is older than that provided by your distribution's repositories.
install.pp
This class handles the installation of the Gluster packages (both server and client).
If the upstream Gluster repo is enabled (default), this class will install packages from there. Otherwise it will attempt to use native OS packages.
Currently, RHEL 6, RHEL 7, Debian 8, Raspbian and Ubuntu provide native Gluster packages (at least client).
class { gluster::install:
server => true,
client => true,
repo => true,
version => 3.5.1-1.el6,
}
Note that on Red Hat (and derivative) systems, the version
parameter should match the version number used by yum for the RPM package.
Beware that Red Hat provides its own build of the GlusterFS FUSE client on RHEL but its minor version doesn't match the upstream. Therefore if you run a community GlusterFS server, you should try to match the version on your RHEL clients by running the community FUSE client.
On Debian-based systems, only the first two version places are significant ("x.y"). The latest minor version from that release will be installed unless the "priority" parameter is used.
client.pp
This class installs only the Gluster client package(s). If you need to install both the server and client, please use the install.pp
(or init.pp
) classes.
class { ::gluster::client:
repo => true,
version => '3.5.2',
}
Use of gluster::client
is not supported with either gluster::install
or gluster::init
.
service.pp
This class manages the glusterd
service.
class { ::gluster::service:
ensure => running,
}
init.pp
This class implements a basic Gluster server.
In the default configuration, this class exports a gluster::peer
defined type for itself, and then collects any other exported gluster::peer
resources for the same pool for instantiation.
This default configuration makes it easy to implement a Gluster storage pool by simply assigning the gluster
class to your Gluster servers: they'll each export their gluster::peer
resources, and then instantiate the other servers' gluster::peer
resources.
The use of exported resources assume you're using PuppetDB, or some other backing mechanism to support exported resources.
If a volumes
parameter is passed, the defined Gluster volume(s) can be created at the same time as the storage pool. See the volume defined type below for more details.
class { ::gluster:
repo => true,
client => false,
pool => 'production',
version => '3.5',
volumes => {
'data1' => {
replica => 2,
bricks => [ 'srv1.local:/export/brick1/brick',
'srv2.local:/export/brick1/brick',
'srv1.local:/export/brick2/brick',
'srv2.local:/export/brick2/brick', ],
options => [ 'server.allow-insecure: on',
'nfs.disable: true', ],
}
}
}
Resources
gluster::peer
This defined type creates a Gluster peering relationship. The name of the resource should be the fully-qualified domain name of a peer to which to connect. An optional pool
parameter permits you to configure different storage pools built from different hosts.
With the exported resource implementation in init.pp
, the first server to be defined in the pool will find no peers, and therefore not do anything. The second server to execute this module will collect the first server's exported resource and initiate the gluster peer probe
, thus creating the storage pool.
Note that the server being probed does not perform any DNS resolution on the server doing the probing. This means that the probed server will report only the IP address of the probing server. The next time the probed client runs this module, it will execute a gluster peer probe
against the originally-probing server, thereby updating its list of peers to use the FQDN of the other server.
See this mailing list post for more information.
gluster::peer { 'srv1.domain:
pool => 'production',
}
gluster::volume
This defined type creates a Gluster volume. You can specify a stripe count, a replica count, the transport type, a list of bricks to use, and an optional set of volume options to enforce.
Note that creating brick filesystems is up to you. May I recommend the Puppet Labs LVM module ?
If using arbiter volumes, you must conform to the replica count that will work with them, at the time of writing this, Gluster 3.12 only supports a configuration of replica => 3, arbiter => 1
.
When creating a new volume, this defined type will ensure that all of the servers hosting bricks in the volume are members of the storage pool. In this way, you can define the volume at the time you create servers, and once the last peer joins the pool the volume will be created.
Any volume options defined will be applied after the volume is created but before the volume is started.
In the event that the list of volume options active on a volume does not match the list of options passed to this defined type, no options will be removed by default. You must set the $remove_options
parameter to true
in order for this defined type to remove options.
Note that adding or removing options does not (currently) restart the volume.
gluster::volume { 'data1':
replica => 2,
bricks => [
'srv1.local:/export/brick1/brick',
'srv2.local:/export/brick1/brick',
'srv1.local:/export/brick2/brick',
'srv2.local:/export/brick2/brick',
],
options => [
'server.allow-insecure: on',
'nfs.ports-insecure: on',
],
}
gluster::volume::option
This defined type applies Gluster options to a volume.
In order to ensure uniqueness across multiple volumes, the title of each gluster::volume::option
must include the name of the volume to which it applies. The format for these titles is volume:option_name
:
gluster::volume::option{ 'g0:nfs.disable':
value => 'on',
}
To remove an option, set the ensure
parameter to absent
:
gluster::volume::option{ 'g0:server.allow-insecure':
ensure => absent,
}
gluster::mount
This defined type mounts a Gluster volume. Most of the parameters to this defined type match either the gluster FUSE options or the Puppet mount options.
gluster::mount { '/gluster/data1':
ensure => present,
volume => 'srv1.local:/data1',
transport => 'tcp',
atboot => true,
dump => 0,
pass => 0,
}
Examples
Please see the examples directory.
Contributing
Pull requests are warmly welcomed!
Copyright
Copyright 2014 CoverMyMeds and released under the terms of the MIT License.
Changelog
All notable changes to this project will be documented in this file. Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module.
v6.0.0 (2021-07-16)
Breaking changes:
- remove EOL OSs and Dependencies; drop puppet 5 support #230 (rwaffen)
- Fix failing CI tests / switch default glusterfs version from 3.12 -> 7.3 #212 (runejuhl)
Implemented enhancements:
- Create new structured facts for
gluster_peers
andgluster_volumes
#186 (tparkercbn)
Fixed bugs:
- Use $fact to retrieve fact #215 (scornelissen85)
Closed issues:
- Newer versions of Gluster #217
- With Puppet 6 it is unable to use volume with dash in name #214
- Support commas in volume options #53
- Weak regex for volume port Fact #33
Merged pull requests:
- Allow latest stdlib/apt modules #229 (bastelfreak)
- modulesync 3.0.0 & puppet-lint autofix #221 (bastelfreak)
- Make volume ensurable #219 (glorpen)
- Use voxpupuli-acceptance #213 (ekohl)
- update repo links to https #211 (bastelfreak)
- Allow puppetlabs/stdlib 6.x #210 (dhoppe)
- Convert gluster::repo::yum to puppet-strings #205 (ekohl)
- Rewrite docs to puppet-strings #204 (ekohl)
v5.0.0 (2019-05-02)
Breaking changes:
- modulesync 2.7.0 and drop puppet 4 #193 (bastelfreak)
- Add arm64, remove i386 compatibility from ::gluster::repo:apt #189 (jacksgt)
- Remove 3.8 repo, use pl-apt 4.4 https support, clean coding #170 (ekohl)
Implemented enhancements:
Fixed bugs:
- Broken facts on gluster3.2 #56
Closed issues:
Merged pull requests:
- Allow puppetlabs/apt 7.x #194 (dhoppe)
- Add Gluster APT Repo PGP fingerprints for 3.13, 4.0, 4.1 and 5+ #188 (jacksgt)
- modulesync 2.1.0 and allow puppet 6.x #183 (bastelfreak)
v4.1.0 (2018-09-09)
Implemented enhancements:
Fixed bugs:
- Allow double digit minor and build versions #164 (gnif)
- Fixed logic for single node gluster servers #127 (glorpen)
Closed issues:
- Regex doesn't match double digit version numbers #162
- Creating volume without replication #88
- Tries to create duplicate volumes if there's only one gluster node #6
Merged pull requests:
- allow puppetlabs/stdlib 5.x and puppetlabs/apt 6.x #178 (bastelfreak)
- use simple quotes for Class names to comply with lint #177 (tbrouhier)
- allow puppetlabs/apt 5.x #174 (bastelfreak)
- drop EOL OSs; fix puppet version range #167 (bastelfreak)
- Rely on beaker-hostgenerator for docker nodesets #166 (ekohl)
- Fix arbiter doc #163 (NITEMAN)
v4.0.0 (2018-03-28)
Breaking changes:
- Add support for gluster 3.10-312; Set default version 3.8->3.12 #143 (bastelfreak)
- Add support for Debian 9, drop debian 8 #139 (bastelfreak)
- replace validate_hash with assert_type #115 (bastelfreak)
- replace validate_* calls with datatypes #114 (bastelfreak)
- replace all validate functions with datatypes #107 (bastelfreak)
Implemented enhancements:
- Enhance tests #113 (bastelfreak)
- Add acceptance #106 (martialblog)
Fixed bugs:
- Arbiter setting not being correctly passed. #151
- Fix repo url for 3.12 in stretch #159 (NITEMAN)
- fix argument passing of arbiter option #150 (sammcj)
Closed issues:
- Gluster Volume Error #152
- Systemd start for glusterfs-server failed! #146
- module mount not working #145
- globbing in apt.pp fails with gluster release 3.10 and newer #140
- Add support for arbiter volumes #134
- Update puppetlabs/apt dependencie #129
- "gluster peer probe" getting called on each puppet run #124
- Apt public key for gluster.org changed address #102
Merged pull requests:
- bump puppet to latest supported version 4.10.0 #160 (bastelfreak)
- Use docker_sets in travis.yml #158 (ekohl)
- increase spec test coverage #157 (bastelfreak)
- Drop Debian 8 acceptance tests #155 (juniorsysadmin)
- Add support for arbiter volumes #133 (sammcj)
- make the code compatible with strict_variables #132 (tequeter)
- update dependency for puppetlabs-apt #130 (TheMeier)
- Fix/types: Fix signature of gluster::volume #119 (ntnn)
v3.0.0 (2017-02-12)
Implemented enhancements:
- Repo refactor #103 (martialblog)
v2.3.0 (2017-01-13)
Merged pull requests:
- Set min version_requirement for Puppet + deps #97 (juniorsysadmin)
v2.2.3 (2016-11-25)
Closed issues:
Merged pull requests:
- Release 2.2.3 #90 (alexjfisher)
- Fixes and tests for strict variables #87 (alexjfisher)
v2.2.2 (2016-10-24)
Closed issues:
Merged pull requests:
- Updating Test Cases for YUM and RPM installation #78 (tux-o-matic)
- release 2.2.2 #77 (bastelfreak)
- Fixed CentOS storage SIG GPG key (issue #63 #68) and server package name #74 (mkmet)
- Fix a misspelling of "therefore" #73 (pioto)
v2.2.1 (2016-10-12)
Merged pull requests:
- release 2.2.1 #72 (bastelfreak)
- Switched YUM repo to use the new CentOS Storage group repository #69 (tux-o-matic)
v2.2.0 (2016-08-17)
Merged pull requests:
- release 2.2.0 #67 (bastelfreak)
- Archlinux Support #55 (bastelfreak)
v2.1.0 (2016-08-10)
Closed issues:
- Release to puppet forge. #32
Merged pull requests:
- Release 2.1.0 #62 (QueerCodingGirl)
- Debian support #59 (NITEMAN)
v2.0.1 (2016-05-11)
Implemented enhancements:
Merged pull requests:
- Release 2.0.1 #52 (bastelfreak)
v2.0.0 (2016-05-11)
Implemented enhancements:
- Enabling first volume creation on Puppet > 4 #24 (tux-o-matic)
Closed issues:
- Volume creation has race condition with fact gluster_volume_list #23
- missing tag on forge.puppetlabs.com #22
- Cannot reassign variable r at volume.pp:264 #18
- Mounts can be defined but mount point will not be created #16
- refreshes to gluster::mount fail to remount the volume #10
- Support yum priorities #4
- ::gluster::volume doesn't create volumes from hosts included in the volume #3
- A stopped volume aborts a Puppet run #1
Merged pull requests:
- Release 2.0.0 #51 (bastelfreak)
- GH-22: Add tags to metadata.json #41 (jyaworski)
- Use force Parameter when adding brick to existing volume #38 (rauchrob)
- Update hyperlink in README.md #37 (rauchrob)
- Fix flags parameter of regsubst function call #36 (rauchrob)
- Update yum repo url #35 (rauchrob)
- Corrected mount options needing to be prefixed by the option name as … #30 (valsr)
- update README to declare move to Puppet Community #27 (skpy)
- Fix reuse of variable name in volume.pp #21 (zstyblik)
- Set repo priority to 'undef' #17 (chuman)
- _netdev is not required for glusterfs. #13 (robertdebock)
- add tests #12 (skpy)
- Pass remounts => false to mount resources #11 (skpy)
- Handle failures from
gluster volume status foo
#9 (skpy) - Add support (and documentation) for yum priorities #5 (skpy)
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/apt (>= 4.4.0 < 9.0.0)
- puppetlabs/stdlib (>= 4.6.0 < 8.0.0)