From 3b0fce6fd3acb9e10eec8d08b4d098a102866304 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Uwe=20J=C3=A4ger?= <uwe.jaeger@valiton.com>
Date: Mon, 19 Feb 2024 13:04:17 +0100
Subject: [PATCH] Update configuration to enable more services in Skyline
 Console

Change-Id: I77f3c5f219393e604dbd24b2a97a66da1ee3ba7f
---
 ansible/roles/skyline/templates/nginx.conf.j2 | 59 ++++++++++++++++++-
 .../roles/skyline/templates/skyline.yaml.j2   |  8 ++-
 ...nclude-more-services-3dbd5351966697cc.yaml |  8 +++
 3 files changed, 72 insertions(+), 3 deletions(-)
 create mode 100644 releasenotes/notes/skyline-include-more-services-3dbd5351966697cc.yaml

diff --git a/ansible/roles/skyline/templates/nginx.conf.j2 b/ansible/roles/skyline/templates/nginx.conf.j2
index 7219d6a1fe..0ecf3f903c 100644
--- a/ansible/roles/skyline/templates/nginx.conf.j2
+++ b/ansible/roles/skyline/templates/nginx.conf.j2
@@ -252,7 +252,62 @@ http {
         }
         {% endif %}
 
-    }
+        {% if enable_barbican | bool %}# Region: {{ openstack_region_name }}, Service: barbican
+        location {{ skyline_nginx_prefix }}/{{ openstack_region_name | lower }}/barbican {
+            proxy_pass {{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ barbican_api_port }}/;
+            proxy_redirect {{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ barbican_api_port }}/ {{ skyline_nginx_prefix }}/{{ openstack_region_name | lower }}/barbican/;
+            proxy_buffering off;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Proto $scheme;
+            proxy_set_header X-Forwarded-Host $host;
+            proxy_set_header Host $http_host;
+        }
+        {% endif %}
 
-}
+        {% if enable_designate | bool %}# Region: {{ openstack_region_name }}, Service: designate
+        location {{ skyline_nginx_prefix }}/{{ openstack_region_name | lower }}/designate {
+            proxy_pass {{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ designate_api_port }}/;
+            proxy_redirect {{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ designate_api_port }}/ {{ skyline_nginx_prefix }}/{{ openstack_region_name | lower }}/designate/;
+            proxy_buffering off;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Proto $scheme;
+            proxy_set_header X-Forwarded-Host $host;
+            proxy_set_header Host $http_host;
+        }
+        {% endif %}
 
+        {% if enable_masakari | bool %}# Region: {{ openstack_region_name }}, Service: masakari
+        location {{ skyline_nginx_prefix }}/{{ openstack_region_name | lower }}/masakari {
+            proxy_pass {{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ masakari_api_port }}/;
+            proxy_redirect {{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ masakari_api_port }}/ {{ skyline_nginx_prefix }}/{{ openstack_region_name | lower }}/masakari/;
+            proxy_buffering off;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Proto $scheme;
+            proxy_set_header X-Forwarded-Host $host;
+            proxy_set_header Host $http_host;
+        }
+        {% endif %}
+
+        {% if enable_swift | bool %}# Region: {{ openstack_region_name }}, Service: swift
+        location {{ skyline_nginx_prefix }}/{{ openstack_region_name | lower }}/swift {
+            proxy_pass {{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ swift_proxy_server_port }}/;
+            proxy_redirect {{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ swift_proxy_server_port }}/ {{ skyline_nginx_prefix }}/{{ openstack_region_name | lower }}/swift/;
+            proxy_buffering off;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Proto $scheme;
+            proxy_set_header X-Forwarded-Host $host;
+            proxy_set_header Host $http_host;
+        }
+        {% elif enable_ceph_rgw | bool %}# Region: {{ openstack_region_name }}, Service: ceph_rgw
+        location {{ skyline_nginx_prefix }}/{{ openstack_region_name | lower }}/swift {
+            proxy_pass {{ internal_protocol }}://{{ ceph_rgw_internal_fqdn }}:{{ ceph_rgw_port }}/{{ 'swift' if not ceph_rgw_swift_compatibility | bool }};
+            proxy_redirect {{ internal_protocol }}://{{ ceph_rgw_internal_fqdn }}:{{ ceph_rgw_port }}/{{ 'swift' if not ceph_rgw_swift_compatibility | bool }} {{ skyline_nginx_prefix }}/{{ openstack_region_name | lower }}/swift/;
+            proxy_buffering off;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Proto $scheme;
+            proxy_set_header X-Forwarded-Host $host;
+            proxy_set_header Host $http_host;
+        }
+        {% endif %}
+    }
+}
diff --git a/ansible/roles/skyline/templates/skyline.yaml.j2 b/ansible/roles/skyline/templates/skyline.yaml.j2
index f998109546..d77dafb26a 100644
--- a/ansible/roles/skyline/templates/skyline.yaml.j2
+++ b/ansible/roles/skyline/templates/skyline.yaml.j2
@@ -47,12 +47,18 @@ openstack:
 {% if enable_trove | bool %}
     database: trove
 {% endif %}
+{% if enable_designate | bool %}
+    dns: designate
+{% endif %}
 {% if enable_keystone | bool %}
     identity: keystone
 {% endif %}
 {% if enable_glance | bool %}
     image: glance
 {% endif %}
+{% if enable_masakari | bool %}
+    instance-ha: masakari
+{% endif %}
 {% if enable_barbican | bool %}
     key-manager: barbican
 {% endif %}
@@ -62,7 +68,7 @@ openstack:
 {% if enable_neutron | bool %}
     network: neutron
 {% endif %}
-{% if enable_swift | bool %}
+{% if enable_swift | bool or enable_ceph_rgw | bool %}
     object-store: swift
 {% endif %}
 {% if enable_heat | bool %}
diff --git a/releasenotes/notes/skyline-include-more-services-3dbd5351966697cc.yaml b/releasenotes/notes/skyline-include-more-services-3dbd5351966697cc.yaml
new file mode 100644
index 0000000000..06c02d0da3
--- /dev/null
+++ b/releasenotes/notes/skyline-include-more-services-3dbd5351966697cc.yaml
@@ -0,0 +1,8 @@
+---
+features:
+  - |
+    Add more services now supported by Skyline to the configuration to make
+    them accessible to Skylines's frontend console.
+    New services include Barbican, Designate, Masakari and Swift or Ceph RGW.
+    Only one of Swift and CEph RGW can be used, if both are enabled, Swift is
+    configured.
-- 
GitLab