diff --git a/ansible/roles/swift/defaults/main.yml b/ansible/roles/swift/defaults/main.yml index 96ab2093e5389ff5d60c9abad5bd7b738c37a0ff..15336706480a34eb4806e2007a7160743c32be80 100644 --- a/ansible/roles/swift/defaults/main.yml +++ b/ansible/roles/swift/defaults/main.yml @@ -78,6 +78,8 @@ syslog_swift_facility: "local0" swift_enable_rolling_upgrade: "yes" +swift_extra_ring_files: [] + #################### # Keystone #################### diff --git a/ansible/roles/swift/tasks/config.yml b/ansible/roles/swift/tasks/config.yml index 21ef7aa67b223f81377a5594c22e94fca5d50bb1..1fd6981fc5cd82ed9c5e5167fa39d3c68021173e 100644 --- a/ansible/roles/swift/tasks/config.yml +++ b/ansible/roles/swift/tasks/config.yml @@ -190,6 +190,7 @@ - "container.ring.gz" - "object.builder" - "object.ring.gz" + - "{{ swift_extra_ring_files }}" - name: Check if policies shall be overwritten local_action: stat path="{{ node_custom_config }}/swift/policy.json" diff --git a/ansible/roles/swift/tasks/precheck.yml b/ansible/roles/swift/tasks/precheck.yml index 297b65be0bfe10e8d94ebae2491ce72c667a7669..6b6767972ebe771a496279a279dd6ef747ea3305 100644 --- a/ansible/roles/swift/tasks/precheck.yml +++ b/ansible/roles/swift/tasks/precheck.yml @@ -108,6 +108,7 @@ - "container.ring.gz" - "object.builder" - "object.ring.gz" + - "{{ swift_extra_ring_files }}" - name: Fail if ring files don't exist run_once: True diff --git a/doc/source/reference/storage/swift-guide.rst b/doc/source/reference/storage/swift-guide.rst index 0742f84bd4489e3f1d8b348889c69f956b4e67bc..022b8a814cc706b49a4990fdeeee16268f997e51 100644 --- a/doc/source/reference/storage/swift-guide.rst +++ b/doc/source/reference/storage/swift-guide.rst @@ -215,6 +215,16 @@ Enable Swift in ``/etc/kolla/globals.yml``: enable_swift : "yes" +If you are to deploy multiple policies, override the variable +``swift_extra_ring_files`` with the list of your custom ring files, .builder +and .ring.gz all together. This will append them to the list of default rings. + +.. code-block:: yaml + + swift_extra_ring_files: + - object-1.builder + - object-1.ring.gz + Once the rings are in place, deploying Swift is the same as any other Kolla Ansible service: diff --git a/releasenotes/notes/swift-multi-policies-28bc322b54a82bf9.yaml b/releasenotes/notes/swift-multi-policies-28bc322b54a82bf9.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5e331228374c29210197a9dc85d40485e9a341e8 --- /dev/null +++ b/releasenotes/notes/swift-multi-policies-28bc322b54a82bf9.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Add a new variable to be used by the swift role, ``swift_extra_ring_files``. + It allows to pass additional ring files to be deployed in the context of + a multi-policy setup.