diff --git a/README.md b/README.md index 5cd36371..1b57f37c 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,8 @@ This defined type creates a Gluster volume. You can specify a stripe count, a re Note that creating brick filesystems is up to you. May I recommend the [Puppet Labs LVM module](https://forge.puppetlabs.com/puppetlabs/lvm) ? +If using [arbiter](https://gluster.readthedocs.io/en/latest/Administrator%20Guide/arbiter-volumes-and-quorum/) 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 => 2, 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. diff --git a/manifests/volume.pp b/manifests/volume.pp index 1f35047c..a6c41ac0 100644 --- a/manifests/volume.pp +++ b/manifests/volume.pp @@ -6,6 +6,7 @@ # # stripe: the stripe count to use for a striped volume # replica: the replica count to use for a replica volume +# arbiter: the arbiter count to use for a replica volume # transport: the transport to use. Defaults to tcp # rebalance: whether to rebalance a volume when new bricks are added # heal: whether to heal a replica volume when adding bricks @@ -50,6 +51,7 @@ Optional[Array] $options = undef, Optional[Integer] $stripe = undef, Optional[Integer] $replica = undef, + Optional[Integer] $arbiter = undef, ) { if $force { @@ -186,10 +188,14 @@ } if $replica { - if ( count($bricks) % $replica ) != 0 { - fail("Number of bricks to add is not a multiple of replica count ${replica}") + if $arbiter and $arbiter != 0 { + $r = "replica ${replica} arbiter ${arbiter}" + } else { + if ( count($bricks) % $replica ) != 0 { + fail("Number of bricks to add is not a multiple of replica count ${replica}") + } + $r = "replica ${replica}" } - $r = "replica ${replica}" } else { $r = '' }