diff --git a/roles/openqa/worker/files/ifcfg-br0 b/roles/openqa/worker/files/ifcfg-br0 new file mode 100644 index 0000000000..5e8ca9aa02 --- /dev/null +++ b/roles/openqa/worker/files/ifcfg-br0 @@ -0,0 +1,10 @@ +DEVICETYPE='ovs' +TYPE='OVSBridge' +BOOTPROTO='static' +IPADDR='10.0.2.2' +NETMASK='255.254.0.0' +DEVICE=br0 +STP=off +ONBOOT='yes' +NAME='br0' +HOTPLUG='no' diff --git a/roles/openqa/worker/tasks/main.yml b/roles/openqa/worker/tasks/main.yml index ec7f87847f..912b826a52 100644 --- a/roles/openqa/worker/tasks/main.yml +++ b/roles/openqa/worker/tasks/main.yml @@ -11,6 +11,7 @@ dnf: name={{ item }} state=present with_items: - openqa-worker + - os-autoinst-openvswitch - libselinux-python - edk2.git-ovmf-x64 tags: @@ -29,6 +30,28 @@ tags: - config +- name: openvswitch service + service: name=openvswitch enabled=yes state=started + with_sequence: "count={{ openqa_workers }}" + +- name: openvswitch bridge device config + copy: src=ifcfg-br0 dest=/etc/sysconfig/network-scripts/ifcfg-br0 owner=root group=root mode=0644 + notify: + - restart NetworkManager + tags: + - config + +- name: openvswitch tap devices config + template: src=ifcfg-tap dest=/etc/sysconfig/network-scripts/ifcfg-tap{{ item }} owner=root group=root mode=0644 + with_sequence: start=0 end={{ openqa_workers | int }} + notify: + - restart NetworkManager + tags: + - config + +- name: os-autoinst openvswitch service + service: name=os-autoinst-openvswitch enabled=yes state=started + - name: Worker services service: name=openqa-worker@{{ item }} enabled=yes state=started with_sequence: "count={{ openqa_workers }}" diff --git a/roles/openqa/worker/templates/ifcfg-tap b/roles/openqa/worker/templates/ifcfg-tap new file mode 100644 index 0000000000..e370fd516c --- /dev/null +++ b/roles/openqa/worker/templates/ifcfg-tap @@ -0,0 +1,7 @@ +DEVICETYPE='ovs' +TYPE='OVSPort' +OVS_BRIDGE='br0' +DEVICE='tap{{ item }}' +ONBOOT='yes' +BOOTPROTO='none' +HOTPLUG='no'