From 634d54b4b1fe5b1559cc775669234b9b6b92b072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20J=C3=A4ger?= Date: Mon, 19 Feb 2024 17:13:47 +0100 Subject: [PATCH] Allow overriding of Skyline logos Change-Id: I3975b5266c8700c81439b4d891d446eba2a52e54 --- ansible/roles/skyline/defaults/main.yml | 5 ++ ansible/roles/skyline/tasks/config.yml | 16 ++++++ .../skyline/templates/skyline-console.json.j2 | 9 ++- .../shared-services/skyline-guide.rst | 57 +++++++++++++++++++ ...line-overwrite-logos-905919a0bada71f9.yaml | 6 ++ 5 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/skyline-overwrite-logos-905919a0bada71f9.yaml diff --git a/ansible/roles/skyline/defaults/main.yml b/ansible/roles/skyline/defaults/main.yml index 7a5a633f16..c329ce80d8 100644 --- a/ansible/roles/skyline/defaults/main.yml +++ b/ansible/roles/skyline/defaults/main.yml @@ -191,3 +191,8 @@ skyline_enable_sso: "no" # TLS #################### skyline_enable_tls_backend: "{{ kolla_enable_tls_backend }}" + +#################### +# Custom logos: files and folders will be copied to static folder +#################### +skyline_custom_logos: [] diff --git a/ansible/roles/skyline/tasks/config.yml b/ansible/roles/skyline/tasks/config.yml index 82ab5aada5..c29d16cbb4 100644 --- a/ansible/roles/skyline/tasks/config.yml +++ b/ansible/roles/skyline/tasks/config.yml @@ -77,3 +77,19 @@ with_dict: "{{ skyline_services }}" notify: - "Restart {{ item.key }} container" + +- name: Copying over custom logos + become: true + vars: + skyline_console: "{{ skyline_services['skyline-console'] }}" + copy: + src: "{{ node_custom_config }}/skyline/logos/{{ item }}" + dest: "{{ node_config_directory }}/skyline-console/logos/" + mode: 0660 + when: + - skyline_console.enabled | bool + - inventory_hostname in groups[skyline_console.group] + - skyline_custom_logos | length > 0 + with_items: "{{ skyline_custom_logos }}" + notify: + - Restart skyline-console container diff --git a/ansible/roles/skyline/templates/skyline-console.json.j2 b/ansible/roles/skyline/templates/skyline-console.json.j2 index 905202f229..30a0750f63 100644 --- a/ansible/roles/skyline/templates/skyline-console.json.j2 +++ b/ansible/roles/skyline/templates/skyline-console.json.j2 @@ -12,7 +12,14 @@ "dest": "/etc/nginx/nginx.conf", "owner": "skyline", "perm": "0600" - }{% if skyline_enable_tls_backend | bool %}, + }{% if skyline_custom_logos | length > 0 %}, + { + "source": "{{ container_config_directory}}/logos", + "dest": "/var/lib/kolla/venv/lib/python{{ distro_python_version }}/site-packages/skyline_console/static", + "owner": "root", + "perm": "0644", + "merge": true + }{% endif %}{% if skyline_enable_tls_backend | bool %}, { "source": "{{ container_config_directory }}/skyline-cert.pem", "dest": "/etc/skyline/certs/skyline-cert.pem", diff --git a/doc/source/reference/shared-services/skyline-guide.rst b/doc/source/reference/shared-services/skyline-guide.rst index 256ee97ed6..c7d8fabc02 100644 --- a/doc/source/reference/shared-services/skyline-guide.rst +++ b/doc/source/reference/shared-services/skyline-guide.rst @@ -24,3 +24,60 @@ enable it with: .. code-block:: yaml skyline_enable_sso: "yes" + +Customize logos +~~~~~~~~~~~~~~~ + +To change some of the logos used by Skyline you can overwrite the default +logos. Not all images can be replaced, you can change the browser icon, the +two logos on the login screen and the logo in the header once you are logged +in. + +To overwrite the files create the directory +``{{ node_custom_config }}/skyline/logos`` and place the files you want to use +there. + +Make sure you have the correct filenames and directory structure as described +below. + +Additionally add the files or directories you created to +``skyline_custom_logos``, a list of files or directories that will be copied +inside the container. + +.. list-table:: Logos/images that can be overwritten + :widths: 30 70 + :header-rows: 1 + + * - Logo/image + - Path in ``{{ node_custom_config }}/skyline/logos`` + * - Browser Icon + - ./favicon.ico + * - Login page left logo + - ./asset/image/logo.png + * - Login page right logo + - ./asset/image/loginRightLogo.png + * - Logo header logged in + - ./asset/image/cloud-logo.svg + + +To replace only the browser icon set + +.. code-block:: yaml + + skyline_custom_logos: ["favicon.ico"] + +To replace files in ``asset`` set + +.. code-block:: yaml + + skyline_custom_logos: ["asset"] + +To replace all use + +.. code-block:: yaml + + skyline_custom_logos: ["asset", "favicon.ico"] + +Since the files are overwritten inside the container, you have to remove the +container and recreate it if you want to revert to the default logos. Just +removing the configuration will not remove the files. diff --git a/releasenotes/notes/skyline-overwrite-logos-905919a0bada71f9.yaml b/releasenotes/notes/skyline-overwrite-logos-905919a0bada71f9.yaml new file mode 100644 index 0000000000..98671a63e6 --- /dev/null +++ b/releasenotes/notes/skyline-overwrite-logos-905919a0bada71f9.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Allow to overwrite Skyline Console logos. Some of the Skyline logos can be + replaced. You can now do this. See the reference documentation for details + `documentation `__.