Skip to content

Commit

Permalink
Adding checks for setup from scratch
Browse files Browse the repository at this point in the history
As discussed in voxpupuli#24 (comment) extra check added to handle creation of volumes from scratch on a Gluster pool.
  • Loading branch information
Benjamin Merot committed Jan 5, 2016
1 parent de7531d commit efea946
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions manifests/volume.pp
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,19 @@
if $binary{
# we need the Gluster binary to do anything!

if $::gluster_peer_list != undef and $::gluster_volume_list != undef {
$minimal_requirements = true
} else {
$minimal_requirements = false
}

if $::gluster_volume_list != undef and member( split( $::gluster_volume_list, ',' ), $title ) {
$already_exists = true
} else {
$already_exists = false
}

if $already_exists == false {
if $minimal_requirements and $already_exists == false {
# this volume has not yet been created

# before we can create it, we need to ensure that all the
Expand Down Expand Up @@ -167,7 +173,7 @@
}
}

} else {
} elsif $already_exists {
# this volume exists

# our fact lists bricks comma-separated, but we need an array
Expand Down

0 comments on commit efea946

Please sign in to comment.