Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debian_hypervisor: synchronize team0_x port state with OVS #666

Open
wants to merge 4 commits into
base: debiancentos
Choose a base branch
from
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
2 changes: 0 additions & 2 deletions roles/debian_hypervisor/files/ovs-vswitchd_override.conf

This file was deleted.

20 changes: 20 additions & 0 deletions roles/debian_hypervisor/files/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Systemd unit wrapping around team0_* ports.
# This can be used to synchronize ports link state with the service that use
# them.

[Unit]
After=network.target
DefaultDependencies=false
Conflicts=shutdown.target
Before=shutdown.target
StopWhenUnneeded=true

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=networkctl up %i
ExecStop=networkctl down %i

[Install]
# empty: This unit must be activated via Wants/Requires of other units that need
# it
16 changes: 12 additions & 4 deletions roles/debian_hypervisor/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,25 @@
owner: root
group: root
mode: 0755
- name: Copy ovs-vswitchd.service drop-in
ansible.builtin.copy:
src: ovs-vswitchd_override.conf
- name: Create ovs-vswitchd.service drop-in
template:
src: ovs-vswitchd_override.conf.j2
dest: /etc/systemd/system/ovs-vswitchd.service.d/override.conf
owner: root
group: root
mode: 0644
register: ovsvswitchd
- name: Copy [email protected] file
ansible.builtin.copy:
src: [email protected]
dest: /etc/systemd/system/[email protected]
owner: root
group: root
mode: 0644
register: team0_x_service
- name: Restart ovs-vswitchd
ansible.builtin.systemd:
state: restarted
daemon_reload: yes
name: ovs-vswitchd
when: ovsvswitchd.changed
when: ovsvswitchd.changed or team0_x_service.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Service]
Slice=ovs.slice

[Unit]
Requires=team0_x@{{team0_0}}.service
Requires=team0_x@{{team0_1}}.service
6 changes: 5 additions & 1 deletion roles/network_networkdwait/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ no requirement.

## Role Variables

no variables.
- cluster_ip_addr
- cluster_protocol
- interfaces_to_wait_for
- team0_0
- team0_1

## Example Playbook

Expand Down