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/handlers/main.yml b/handlers/main.yml index f6accca..8aa6b51 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -20,4 +20,18 @@ state: restarted enabled: true ignore_errors: "{{ ansible_check_mode }}" + +- name: Restart openqa services + ansible.builtin.systemd: + name: "{{ item }}" + state: restarted + loop: "{{ openqa_services }}" + ignore_errors: "{{ ansible_check_mode }}" + +- name: Restart os-autoinst-openvswitch + ansible.builtin.systemd: + name: os-autoinst-openvswitch + state: restarted + enabled: true + ignore_errors: "{{ ansible_check_mode }}" ... diff --git a/init-rocky-openqa-developer-host.yml b/init-rocky-openqa-developer-host.yml index 811a5b9..d113ea4 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: @@ -43,6 +44,9 @@ - name: Install and configure OpenQA ansible.builtin.import_tasks: tasks/openqa.yml + - name: Apply Rocky Linux OpenQA Branding + ansible.builtin.import_tasks: tasks/openqa_branding.yml + post_tasks: - name: Touching run file that ansible has ran here ansible.builtin.file: diff --git a/tasks/openqa-multivm-networking.yml b/tasks/openqa-multivm-networking.yml index 15ec7a6..884b678 100644 --- a/tasks/openqa-multivm-networking.yml +++ b/tasks/openqa-multivm-networking.yml @@ -12,46 +12,25 @@ pkg: - os-autoinst-openvswitch - tunctl - - network-scripts - name: Create /etc/sysconfig/os-autoinst-openvswitch ansible.builtin.copy: + src: etc/sysconfig/os-autoinst-openvswitch.j2 dest: /etc/sysconfig/os-autoinst-openvswitch mode: '0644' - content: | - OS_AUTOINST_BRIDGE_LOCAL_IP=172.16.2.2 - OS_AUTOINST_BRIDGE_REWRITE_TARGET=172.17.0.0 - OS_AUTOINST_USE_BRIDGE={{ openqa_multivm_bridge_interface }} - notify: restart_os-autoinst-openvswitch + notify: Restart os-autoinst-openvswitch - name: Create bridge interface configuration ansible.builtin.copy: + src: etc/sysconfig/network-scripts/ifcfg-br.j2 dest: /etc/sysconfig/network-scripts/ifcfg-{{ openqa_multivm_bridge_interface }} mode: '0644' - content: | - DEVICETYPE='ovs' - TYPE='OVSBridge' - BOOTPROTO='static' - IPADDR='172.16.2.2' - NETMASK='255.254.0.0' - DEVICE={{ openqa_multivm_bridge_interface }} - STP=off - ONBOOT='yes' - NAME='{{ openqa_multivm_bridge_interface }}' - HOTPLUG='no' - name: Create worker tap interface configs ansible.builtin.copy: + src: etc/sysconfig/network-scripts/ifcfg-tap.j2 dest: /etc/sysconfig/network-scripts/ifcfg-tap{{ item }} mode: '0644' - content: | - DEVICETYPE='ovs' - TYPE='OVSPort' - OVS_BRIDGE='{{ openqa_multivm_bridge_interface }}' - DEVICE='tap{{ item }}' - ONBOOT='yes' - BOOTPROTO='none' - HOTPLUG='no' loop: "{{ range(openqa_worker_count) | list }}" - name: Update /sbin/ifup-pre-local @@ -66,7 +45,7 @@ interface: '{{ openqa_multivm_bridge_interface }}' state: enabled zone: internal - notify: reload_firewalld + notify: Reload firewalld - name: Enable masquerade for public and internal zones ansible.posix.firewalld: @@ -77,7 +56,7 @@ loop: - public - internal - notify: reload_firewalld + notify: Reload firewalld - name: Enable ipv4 IP forwarding ansible.posix.sysctl: @@ -93,7 +72,7 @@ state: present zone: public target: ACCEPT - notify: reload_firewalld + notify: Reload firewalld # Only needed for multi-host setups - name: Add port for GRE tunnel @@ -109,7 +88,6 @@ enabled: true loop: - openvswitch - - network - os-autoinst-openvswitch ignore_errors: "{{ ansible_check_mode }}" @@ -121,7 +99,7 @@ value: qemu_x86_64,tap state: present mode: '0644' - notify: restart_openqa_services + notify: Restart openqa services - name: Enable bridge interface for openvswitch ansible.builtin.command: ovs-vsctl add-br {{ openqa_multivm_bridge_interface }} 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..ad577d8 --- /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} +...