diff --git a/files/usr/share/openqa/assets/assetpack.def.patch b/files/usr/share/openqa/assets/assetpack.def.patch new file mode 100644 index 0000000..21f83dc --- /dev/null +++ b/files/usr/share/openqa/assets/assetpack.def.patch @@ -0,0 +1,15 @@ +--- assetpack.def.orig 2023-01-24 03:37:58.521562449 +0000 ++++ assetpack.def 2023-01-24 03:38:14.488517673 +0000 +@@ -246,6 +246,12 @@ + ! terminal.svg + < images/terminal.svg + ++! rocky.png ++< images/rocky.png ++ ++! rocky.svg ++< images/rocky.svg ++ + ! suse.png + < images/suse.png + diff --git a/files/usr/share/openqa/assets/images/rocky.png b/files/usr/share/openqa/assets/images/rocky.png new file mode 100644 index 0000000..d600b12 Binary files /dev/null and b/files/usr/share/openqa/assets/images/rocky.png differ diff --git a/files/usr/share/openqa/assets/images/rocky.svg b/files/usr/share/openqa/assets/images/rocky.svg new file mode 100644 index 0000000..920ba29 --- /dev/null +++ b/files/usr/share/openqa/assets/images/rocky.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/files/usr/share/openqa/templates/webapi/branding/rocky/docbox.html.ep b/files/usr/share/openqa/templates/webapi/branding/rocky/docbox.html.ep new file mode 100644 index 0000000..bc1a2d9 --- /dev/null +++ b/files/usr/share/openqa/templates/webapi/branding/rocky/docbox.html.ep @@ -0,0 +1 @@ +%=include 'branding/plain/docbox' diff --git a/files/usr/share/openqa/templates/webapi/branding/rocky/sponsorbox.html.ep b/files/usr/share/openqa/templates/webapi/branding/rocky/sponsorbox.html.ep new file mode 100644 index 0000000..46e8287 --- /dev/null +++ b/files/usr/share/openqa/templates/webapi/branding/rocky/sponsorbox.html.ep @@ -0,0 +1,5 @@ +
+ + sponsor_rocky_linux + +
diff --git a/files/usr/share/openqa/templates/webapi/main/index.html.ep.patch b/files/usr/share/openqa/templates/webapi/main/index.html.ep.patch new file mode 100644 index 0000000..b767e62 --- /dev/null +++ b/files/usr/share/openqa/templates/webapi/main/index.html.ep.patch @@ -0,0 +1,15 @@ +--- index.html.ep 2023-01-24 03:34:10.861205160 +0000 ++++ index.html.ep 2023-01-24 03:34:44.364110582 +0000 +@@ -10,10 +10,10 @@ +
+
+
+-
++
+ %= include_branding 'docbox' +
+-
++
+ %= include_branding 'sponsorbox' +
+
diff --git a/init-rocky-openqa-developer-host.yml b/init-rocky-openqa-developer-host.yml index f462e9b..b946e2b 100644 --- a/init-rocky-openqa-developer-host.yml +++ b/init-rocky-openqa-developer-host.yml @@ -20,6 +20,7 @@ become: true vars_files: - vars/openqa.yml + - vars/openqa_branding.yml # This is to try to avoid the handler issue in pre/post tasks handlers: @@ -41,6 +42,8 @@ tasks: - name: Install and configure OpenQA import_tasks: tasks/openqa.yml + - name: Apply Rocky Linux OpenQA Branding + import_tasks: tasks/openqa_branding.yml post_tasks: - name: Touching run file that ansible has ran here diff --git a/tasks/openqa_branding.yml b/tasks/openqa_branding.yml new file mode 100644 index 0000000..29f6e6e --- /dev/null +++ b/tasks/openqa_branding.yml @@ -0,0 +1,35 @@ +--- +- name: Copy assets hierarchy + ansible.posix.synchronize: + src: "{{ assets_src_dir }}/" + dest: "{{ assets_dest_dir }}" + recursive: true + tags: + - branding + +- name: Copy templates hierarchy + ansible.posix.synchronize: + src: "{{ templates_src_dir }}/" + dest: "{{ templates_dest_dir }}" + recursive: true + tags: + - branding + +- name: Apply patches to specific assets, template and config files + ansible.posix.patch: + src: "{{ item.patch }}" + dest: "{{ item.path }}" + # optional parameters, see documentation for details + # strip: 1 + backup: true + with_items: "{{ branding_patches }}" + tags: + - branding + +- name: Restart openqa-webui service + ansible.builtin.systemd: + name: openqa-webui + state: restarted + tags: + - branding +... diff --git a/templates/etc/openqa/openqa.ini.j2 b/templates/etc/openqa/openqa.ini.j2 index 932c182..7cadafc 100644 --- a/templates/etc/openqa/openqa.ini.j2 +++ b/templates/etc/openqa/openqa.ini.j2 @@ -1,5 +1,5 @@ [global] -branding=plain +branding = {{ openqa_branding }} download_domains = rockylinux.org fedoraproject.org opensuse.org [auth] diff --git a/vars/openqa_branding.yml b/vars/openqa_branding.yml new file mode 100644 index 0000000..e294070 --- /dev/null +++ b/vars/openqa_branding.yml @@ -0,0 +1,14 @@ +--- +# Branding type used, default is plain but we are rocky +openqa_branding: "rocky" + +assets_src_dir: "{{ playbook_dir }}/files/usr/share/openqa/assets" +assets_dest_dir: "/usr/share/openqa/assets" + +templates_src_dir: "{{ playbook_dir }}/files/usr/share/openqa/templates" +templates_dest_dir: "/usr/share/openqa/templates" + +branding_patches: + - { path: /usr/share/openqa/assets/assetpack.def, patch: /usr/share/openqa/assets/assetpack.def.patch } + - { path: /usr/share/openqa/templates/webapi/main/index.html.ep, patch: /usr/share/openqa/templates/webapi/main/index.html.ep.patch } +...