diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-06-14 01:00:37 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-06-14 01:00:37 +0000 |
commit | 322888dc08bc8b781f527049c5bcc665491973d1 (patch) | |
tree | 1a508a005a6c298a7022d0804fdacb08d5ee0625 /manifests/profile | |
parent | c54c7d5caddcbf36db31a4d478f293a86faf0154 (diff) | |
parent | 410e05ba63cad12d99f33717d116213a38413740 (diff) |
Merge "Fix Swift ring management in container deployments"
Diffstat (limited to 'manifests/profile')
-rw-r--r-- | manifests/profile/base/swift/ringbuilder.pp | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/manifests/profile/base/swift/ringbuilder.pp b/manifests/profile/base/swift/ringbuilder.pp index f6f8f06..67156d4 100644 --- a/manifests/profile/base/swift/ringbuilder.pp +++ b/manifests/profile/base/swift/ringbuilder.pp @@ -69,6 +69,10 @@ # [*swift_ring_put_tempurl*] # PUT tempurl to upload Swift rings to # +# [*skip_consistency_check*] +# If set to true, skip the recon check to ensure rings are identical on all +# nodes. Defaults to false +# class tripleo::profile::base::swift::ringbuilder ( $replicas, $build_ring = true, @@ -82,9 +86,10 @@ class tripleo::profile::base::swift::ringbuilder ( $min_part_hours = undef, $swift_ring_get_tempurl = hiera('swift_ring_get_tempurl', ''), $swift_ring_put_tempurl = hiera('swift_ring_put_tempurl', ''), + $skip_consistency_check = false, ) { - if $step == 2 and $swift_ring_get_tempurl != '' { + if $step >= 2 and $swift_ring_get_tempurl != '' { exec{'fetch_swift_ring_tarball': path => ['/usr/bin'], command => "curl --insecure --silent '${swift_ring_get_tempurl}' -o /tmp/swift-rings.tar.gz", @@ -135,17 +140,30 @@ class tripleo::profile::base::swift::ringbuilder ( } } - if $step == 5 and $build_ring and $swift_ring_put_tempurl != '' { - exec{'create_swift_ring_tarball': - path => ['/bin', '/usr/bin'], - command => 'tar cvzf /tmp/swift-rings.tar.gz /etc/swift/*.builder /etc/swift/*.ring.gz /etc/swift/backups/', - unless => 'swift-recon --md5 | grep -q "doesn\'t match"' - } ~> + if $step >= 5 and $build_ring and $swift_ring_put_tempurl != '' { + if $skip_consistency_check { + exec{'create_swift_ring_tarball': + path => ['/bin', '/usr/bin'], + command => 'tar cvzf /tmp/swift-rings.tar.gz /etc/swift/*.builder /etc/swift/*.ring.gz /etc/swift/backups/', + } + } else { + exec{'create_swift_ring_tarball': + path => ['/bin', '/usr/bin'], + command => 'tar cvzf /tmp/swift-rings.tar.gz /etc/swift/*.builder /etc/swift/*.ring.gz /etc/swift/backups/', + unless => 'swift-recon --md5 | grep -q "doesn\'t match"', + } + } exec{'upload_swift_ring_tarball': path => ['/usr/bin'], command => "curl --insecure --silent -X PUT '${$swift_ring_put_tempurl}' --data-binary @/tmp/swift-rings.tar.gz", require => Exec['create_swift_ring_tarball'], refreshonly => true, } + + Exec['rebalance_account'] ~> Exec['create_swift_ring_tarball'] + Exec['rebalance_container'] ~> Exec['create_swift_ring_tarball'] + Exec['rebalance_object'] ~> Exec['create_swift_ring_tarball'] + + Exec['create_swift_ring_tarball'] ~> Exec['upload_swift_ring_tarball'] } } |