Decouple Swift ringbuilding logic

This reverts commit b323f8a160 and uses
the new logic in puppet-tripleo (see Ifd6fa5b398d98e8998630ea0c9a2ce9867ceba2b
), basically doing the same.

Closes-Bug: 1665641
Change-Id: Ib5cb0578be2993af0a0b8675005d838640bdb139
changes/47/436247/6
Christian Schwede 6 years ago
parent 2bc62ed305
commit 76c1c0cbba
  1. 31
      extraconfig/tasks/swift-ring-deploy.yaml
  2. 42
      extraconfig/tasks/swift-ring-update.yaml
  3. 3
      overcloud-resource-registry-puppet.j2.yaml
  4. 18
      puppet/puppet-steps.j2
  5. 10
      puppet/services/swift-ringbuilder.yaml

@ -1,31 +0,0 @@
heat_template_version: ocata
parameters:
servers:
type: json
SwiftRingGetTempurl:
default: ''
description: A temporary Swift URL to download rings from.
type: string
resources:
SwiftRingDeployConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
inputs:
- name: swift_ring_get_tempurl
config: |
#!/bin/sh
pushd /
curl --insecure --silent "${swift_ring_get_tempurl}" | tar xz || true
popd
SwiftRingDeploy:
type: OS::Heat::SoftwareDeployments
properties:
name: SwiftRingDeploy
config: {get_resource: SwiftRingDeployConfig}
servers: {get_param: servers}
input_values:
swift_ring_get_tempurl: {get_param: SwiftRingGetTempurl}

@ -1,42 +0,0 @@
heat_template_version: ocata
parameters:
servers:
type: json
SwiftRingPutTempurl:
default: ''
description: A temporary Swift URL to upload rings to.
type: string
resources:
SwiftRingUpdateConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
inputs:
- name: swift_ring_put_tempurl
config: |
#!/bin/sh
TMP_DATA=$(mktemp -d)
function cleanup {
rm -Rf "$TMP_DATA"
}
trap cleanup EXIT
# sanity check in case rings are not consistent within cluster
swift-recon --md5 | grep -q "doesn't match" && exit 1
pushd ${TMP_DATA}
tar -cvzf swift-rings.tar.gz /etc/swift/*.builder /etc/swift/*.ring.gz /etc/swift/backups/*
resp=`curl --insecure --silent -X PUT "${swift_ring_put_tempurl}" --write-out "%{http_code}" --data-binary @swift-rings.tar.gz`
popd
if [ "$resp" != "201" ]; then
exit 1
fi
SwiftRingUpdate:
type: OS::Heat::SoftwareDeployments
properties:
name: SwiftRingUpdate
config: {get_resource: SwiftRingUpdateConfig}
servers: {get_param: servers}
input_values:
swift_ring_put_tempurl: {get_param: SwiftRingPutTempurl}

@ -11,9 +11,6 @@ resource_registry:
OS::TripleO::Tasks::UpdateWorkflow: OS::Heat::None
OS::TripleO::Tasks::PackageUpdate: extraconfig/tasks/yum_update.yaml
OS::TripleO::Tasks::SwiftRingDeploy: extraconfig/tasks/swift-ring-deploy.yaml
OS::TripleO::Tasks::SwiftRingUpdate: extraconfig/tasks/swift-ring-update.yaml
{% for role in roles %}
OS::TripleO::{{role.name}}::PreNetworkConfig: OS::Heat::None
OS::TripleO::{{role.name}}PostDeploySteps: puppet/post.yaml

@ -30,13 +30,6 @@
input_values:
update_identifier: {get_param: DeployIdentifier}
{% if role.name in ['Controller', 'ObjectStorage'] %}
{{role.name}}SwiftRingDeploy:
type: OS::TripleO::Tasks::SwiftRingDeploy
properties:
servers: {get_param: [servers, {{role.name}}]}
{% endif %}
# Step through a series of configuration steps
{% for step in range(1, 6) %}
{{role.name}}Deployment_Step{{step}}:
@ -88,15 +81,4 @@
servers: {get_param: [servers, {{role.name}}]}
input_values:
update_identifier: {get_param: DeployIdentifier}
{% if role.name in ['Controller', 'ObjectStorage'] %}
{{role.name}}SwiftRingUpdate:
type: OS::TripleO::Tasks::SwiftRingUpdate
depends_on:
{% for dep in roles %}
- {{dep.name}}Deployment_Step5
{% endfor %}
properties:
servers: {get_param: [servers, {{role.name}}]}
{% endif %}
{% endfor %}

@ -42,6 +42,14 @@ parameters:
default: true
description: 'Use a local directory for Swift storage services when building rings'
type: boolean
SwiftRingGetTempurl:
default: ''
description: A temporary Swift URL to download rings from.
type: string
SwiftRingPutTempurl:
default: ''
description: A temporary Swift URL to upload rings to.
type: string
conditions:
swift_use_local_dir:
@ -59,6 +67,8 @@ outputs:
value:
service_name: swift_ringbuilder
config_settings:
tripleo::profile::base::swift::ringbuilder::swift_ring_get_tempurl: {get_param: SwiftRingGetTempurl}
tripleo::profile::base::swift::ringbuilder::swift_ring_put_tempurl: {get_param: SwiftRingPutTempurl}
tripleo::profile::base::swift::ringbuilder::build_ring: {get_param: SwiftRingBuild}
tripleo::profile::base::swift::ringbuilder::replicas: {get_param: SwiftReplicas}
tripleo::profile::base::swift::ringbuilder::part_power: {get_param: SwiftPartPower}

Loading…
Cancel
Save