X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=puppet%2Fmanifests%2Fringbuilder.pp;h=2411ff842f26a4a54e91d4ef643c753956012f10;hb=2191c265004392de7dec109c51fc4fe63dbb381c;hp=531706d263b73847a749cc12627dd5f8c61a3dd7;hpb=6b5ac01d2e61af9efddd01b58bfc0f6cd1e8518f;p=apex-tripleo-heat-templates.git diff --git a/puppet/manifests/ringbuilder.pp b/puppet/manifests/ringbuilder.pp index 531706d2..2411ff84 100644 --- a/puppet/manifests/ringbuilder.pp +++ b/puppet/manifests/ringbuilder.pp @@ -13,17 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -if str2bool(hiera('disable_package_install', 'false')) { - case $::osfamily { - 'RedHat': { - Package { provider => 'norpm' } # provided by tripleo-puppet - } - default: { - warning('disable_package_install option not supported.') - } - } -} - define add_devices( $swift_zones = '1' ){ @@ -46,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 @@ -98,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 +}