X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=puppet%2Fmanifests%2Fringbuilder.pp;h=2411ff842f26a4a54e91d4ef643c753956012f10;hb=af9352e8007f8eb9a0bbec36a49e07328b0cd3f6;hp=14fbafdddbeb6abe306ee49d0b78d1d0dbb4f045;hpb=5a6e934b4b8d6fab7b899c368fb82321e1a0cbe3;p=apex-tripleo-heat-templates.git diff --git a/puppet/manifests/ringbuilder.pp b/puppet/manifests/ringbuilder.pp index 14fbafdd..2411ff84 100644 --- a/puppet/manifests/ringbuilder.pp +++ b/puppet/manifests/ringbuilder.pp @@ -13,8 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -include tripleo::packages - define add_devices( $swift_zones = '1' ){ @@ -37,44 +35,46 @@ define add_devices( $base = regsubst($name,'^r1.*-(.*)$','\1') $object = regsubst($base, '%PORT%', '6000') ring_object_device { $object: - zone => '1', - weight => 100, + zone => '1', + weight => 100, } $container = regsubst($base, '%PORT%', '6001') ring_container_device { $container: - zone => '1', - weight => 100, + zone => '1', + weight => 100, } $account = regsubst($base, '%PORT%', '6002') ring_account_device { $account: - zone => '1', - weight => 100, + zone => '1', + weight => 100, } } class tripleo::ringbuilder ( $swift_zones = '1', $devices = '', - $build_ring = 'True', + $build_ring = true, $part_power, $replicas, $min_part_hours, ) { - if str2bool(downcase("$build_ring")) { + validate_bool($build_ring) + + if $build_ring { $device_array = strip(split(rstrip($devices), ',')) # create local rings swift::ringbuilder::create{ ['object', 'account', 'container']: part_power => $part_power, - replicas => $replicas, + replicas => min(count($device_array), $replicas), min_part_hours => $min_part_hours, } -> # add all other devices add_devices {$device_array: - swift_zones => $swift_zones + swift_zones => $swift_zones, } -> # rebalance @@ -89,4 +89,11 @@ class tripleo::ringbuilder ( } } -include ::tripleo::ringbuilder +if hiera('step') >= 2 { + # pre-install swift here so we can build rings + include ::swift +} + +if hiera('step') >= 3 { + include ::tripleo::ringbuilder +}