From 5f4c71ee0f2b1c50675ab4241db89e81a3c27d86 Mon Sep 17 00:00:00 2001
From: Alexis Deberg <alexis.deberg@ubisoft.com>
Date: Thu, 24 Oct 2019 12:24:27 -0400
Subject: [PATCH] Update swift templates to support swift_extra_ring_files

Change-Id: Ie594f6cdbe332d64d3461d84da730111d0db5cf1
Related-Bug: #1844752
---
 .../roles/swift/templates/swift-object-auditor.json.j2    | 8 ++++++++
 .../roles/swift/templates/swift-object-expirer.json.j2    | 8 ++++++++
 .../templates/swift-object-replication-server.json.j2     | 8 ++++++++
 .../roles/swift/templates/swift-object-replicator.json.j2 | 8 ++++++++
 ansible/roles/swift/templates/swift-object-server.json.j2 | 8 ++++++++
 .../roles/swift/templates/swift-object-updater.json.j2    | 8 ++++++++
 ansible/roles/swift/templates/swift-proxy-server.json.j2  | 8 ++++++++
 7 files changed, 56 insertions(+)

diff --git a/ansible/roles/swift/templates/swift-object-auditor.json.j2 b/ansible/roles/swift/templates/swift-object-auditor.json.j2
index 3dc84a49cf..51df1a2eee 100644
--- a/ansible/roles/swift/templates/swift-object-auditor.json.j2
+++ b/ansible/roles/swift/templates/swift-object-auditor.json.j2
@@ -13,6 +13,14 @@
             "owner": "swift",
             "perm": "0640"
         },
+        {% for ring in swift_extra_ring_files %}
+        {
+            "source": "/var/lib/kolla/swift/{{ ring }}",
+            "dest": "/etc/swift/{{ ring }}",
+            "owner": "swift",
+            "perm": "0640"
+        },
+        {% endfor %}
         {
             "source": "{{ container_config_directory }}/swift.conf",
             "dest": "/etc/swift/swift.conf",
diff --git a/ansible/roles/swift/templates/swift-object-expirer.json.j2 b/ansible/roles/swift/templates/swift-object-expirer.json.j2
index a87390ee7f..639f41e812 100644
--- a/ansible/roles/swift/templates/swift-object-expirer.json.j2
+++ b/ansible/roles/swift/templates/swift-object-expirer.json.j2
@@ -19,6 +19,14 @@
             "owner": "swift",
             "perm": "0640"
         },
+        {% for ring in swift_extra_ring_files %}
+        {
+            "source": "/var/lib/kolla/swift/{{ ring }}",
+            "dest": "/etc/swift/{{ ring }}",
+            "owner": "swift",
+            "perm": "0640"
+        },
+        {% endfor %}
         {
             "source": "{{ container_config_directory }}/swift.conf",
             "dest": "/etc/swift/swift.conf",
diff --git a/ansible/roles/swift/templates/swift-object-replication-server.json.j2 b/ansible/roles/swift/templates/swift-object-replication-server.json.j2
index c63005e70e..c5ddf90d31 100644
--- a/ansible/roles/swift/templates/swift-object-replication-server.json.j2
+++ b/ansible/roles/swift/templates/swift-object-replication-server.json.j2
@@ -13,6 +13,14 @@
             "owner": "swift",
             "perm": "0640"
         },
+        {% for ring in swift_extra_ring_files %}
+        {
+            "source": "/var/lib/kolla/swift/{{ ring }}",
+            "dest": "/etc/swift/{{ ring }}",
+            "owner": "swift",
+            "perm": "0640"
+        },
+        {% endfor %}
         {
             "source": "{{ container_config_directory }}/swift.conf",
             "dest": "/etc/swift/swift.conf",
diff --git a/ansible/roles/swift/templates/swift-object-replicator.json.j2 b/ansible/roles/swift/templates/swift-object-replicator.json.j2
index 8b6b42a8e1..88c46cd342 100644
--- a/ansible/roles/swift/templates/swift-object-replicator.json.j2
+++ b/ansible/roles/swift/templates/swift-object-replicator.json.j2
@@ -13,6 +13,14 @@
             "owner": "swift",
             "perm": "0640"
         },
+        {% for ring in swift_extra_ring_files %}
+        {
+            "source": "/var/lib/kolla/swift/{{ ring }}",
+            "dest": "/etc/swift/{{ ring }}",
+            "owner": "swift",
+            "perm": "0640"
+        },
+        {% endfor %}
         {
             "source": "{{ container_config_directory }}/swift.conf",
             "dest": "/etc/swift/swift.conf",
diff --git a/ansible/roles/swift/templates/swift-object-server.json.j2 b/ansible/roles/swift/templates/swift-object-server.json.j2
index dcccab7011..2b0687c154 100644
--- a/ansible/roles/swift/templates/swift-object-server.json.j2
+++ b/ansible/roles/swift/templates/swift-object-server.json.j2
@@ -13,6 +13,14 @@
             "owner": "swift",
             "perm": "0640"
         },
+        {% for ring in swift_extra_ring_files %}
+        {
+            "source": "/var/lib/kolla/swift/{{ ring }}",
+            "dest": "/etc/swift/{{ ring }}",
+            "owner": "swift",
+            "perm": "0640"
+        },
+        {% endfor %}
         {
             "source": "{{ container_config_directory }}/swift.conf",
             "dest": "/etc/swift/swift.conf",
diff --git a/ansible/roles/swift/templates/swift-object-updater.json.j2 b/ansible/roles/swift/templates/swift-object-updater.json.j2
index 5d1347c9c5..1b6469c36b 100644
--- a/ansible/roles/swift/templates/swift-object-updater.json.j2
+++ b/ansible/roles/swift/templates/swift-object-updater.json.j2
@@ -13,6 +13,14 @@
             "owner": "swift",
             "perm": "0640"
         },
+        {% for ring in swift_extra_ring_files %}
+        {
+            "source": "/var/lib/kolla/swift/{{ ring }}",
+            "dest": "/etc/swift/{{ ring }}",
+            "owner": "swift",
+            "perm": "0640"
+        },
+        {% endfor %}
         {
             "source": "{{ container_config_directory }}/swift.conf",
             "dest": "/etc/swift/swift.conf",
diff --git a/ansible/roles/swift/templates/swift-proxy-server.json.j2 b/ansible/roles/swift/templates/swift-proxy-server.json.j2
index b695210a8f..a1f4daea59 100644
--- a/ansible/roles/swift/templates/swift-proxy-server.json.j2
+++ b/ansible/roles/swift/templates/swift-proxy-server.json.j2
@@ -19,6 +19,14 @@
             "owner": "swift",
             "perm": "0640"
         },
+        {% for ring in swift_extra_ring_files %}
+        {
+            "source": "/var/lib/kolla/swift/{{ ring }}",
+            "dest": "/etc/swift/{{ ring }}",
+            "owner": "swift",
+            "perm": "0640"
+        },
+        {% endfor %}
         {
             "source": "{{ container_config_directory }}/swift.conf",
             "dest": "/etc/swift/swift.conf",
-- 
GitLab