Skip to content

Commit

Permalink
feat: add capability to create disperse volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
svenbs committed Apr 29, 2020
1 parent 36e3b6c commit a4be681
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions manifests/volume.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#
# @param stripe
# the stripe count to use for a striped volume
# @param disperse
# the brick count to use for a disperse volume
# @param redundancy
# the failure tolerance to use for a disperse volume
# @param replica
# the replica count to use for a replica volume
# @param arbiter
Expand Down Expand Up @@ -50,6 +54,8 @@
Boolean $remove_options = false,
Optional[Array] $options = undef,
Optional[Integer] $stripe = undef,
Optional[Integer] $disperse = undef,
Optional[Integer] $redundancy = undef,
Optional[Integer] $replica = undef,
Optional[Integer] $arbiter = undef,
) {
Expand All @@ -66,6 +72,18 @@
$_stripe = ''
}

if $_isperse {
$_disperse = "disperse ${disperse}"
} else {
$_disperse = ''
}

if $_redundancy {
$_redundancy = "redundancy ${redundancy}"
} else {
$_redundancy = ''
}

$_replica = if $replica {
"replica ${replica}"
} else {
Expand All @@ -90,6 +108,8 @@

$cmd_args = [
$_stripe,
$_disperse,
$_redundancy,
$_replica,
$_arbiter,
$_transport,
Expand Down

0 comments on commit a4be681

Please sign in to comment.