++
+ %= 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}
+...