Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion roles/deploy_python3_setup_ovs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ No requirement.

## Role Variables

No variable.
| Variable | Default | Description |
|--------------------------------------|---------|------------------------------------------------------------------------------------------------------------------------|
| `deploy_python3_setup_ovs_qemu_user` | `qemu` | System user that runs QEMU guests. Used for ownership of the OVS VM socket directory. Set to `libvirt-qemu` on Debian. |

## Example Playbook

Expand Down
5 changes: 5 additions & 0 deletions roles/deploy_python3_setup_ovs/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (C) 2025 RTE
# SPDX-License-Identifier: Apache-2.0

---
deploy_python3_setup_ovs_qemu_user: qemu
6 changes: 3 additions & 3 deletions roles/deploy_python3_setup_ovs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
command:
cmd: "/usr/bin/pip install {{ deploy_python3_setup_ovs_pip_options }} /tmp/src/python3-setup-ovs"
changed_when: true
- name: Copy seapath-config_ovs.service
ansible.builtin.copy:
src: seapath-config_ovs.service
- name: Deploy seapath-config_ovs.service
ansible.builtin.template:
src: seapath-config_ovs.service.j2
dest: /etc/systemd/system/seapath-config_ovs.service
mode: '0644'
notify: Trigger daemon-reload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Before=systemd-networkd.service
[Service]
Type=oneshot
RemainAfterExit=true
ExecStartPre=/bin/mkdir -p /var/run/openvswitch/vm-sockets
ExecStartPre=/bin/chown {{ deploy_python3_setup_ovs_qemu_user }}:root /var/run/openvswitch/vm-sockets
ExecStartPre=/bin/chmod 0750 /var/run/openvswitch/vm-sockets
ExecStart=/usr/local/bin/setup_ovs

[Install]
Expand Down
1 change: 1 addition & 0 deletions roles/deploy_python3_setup_ovs/vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
# SPDX-License-Identifier: Apache-2.0

deploy_python3_setup_ovs_pip_options: "--root-user-action=ignore --no-build-isolation --prefix=/usr/"
deploy_python3_setup_ovs_qemu_user: libvirt-qemu
34 changes: 34 additions & 0 deletions roles/network_configovs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,40 @@
- name: Load distribution-specific variables
include_vars: "{{ seapath_distro }}.yml"

- name: Detect DPDK usage from OVS bridge configuration
set_fact:
dpdk_enabled: >-
{{ ovs_bridges | default([])
| map(attribute='ports', default=[])
| flatten
| selectattr('type', 'in', ['dpdk', 'dpdkvhostuserclient'])
| list | length > 0 }}
when: seapath_distro == "Debian"

- name: Load vfio-pci module for DPDK
community.general.modprobe:
name: vfio-pci
state: present
persistent: present
when:
- dpdk_enabled | bool

- name: Switch to OVS with DPDK support
community.general.alternatives:
name: ovs-vswitchd
path: /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk
when:
- seapath_distro == "Debian"
- dpdk_enabled | bool

- name: Switch to OVS without DPDK support
community.general.alternatives:
name: ovs-vswitchd
path: /usr/lib/openvswitch-switch/ovs-vswitchd
when:
- seapath_distro == "Debian"
- not dpdk_enabled | bool

- name: Create OVS configuration
template:
src: ovs_configuration.json.j2
Expand Down