Skip to content

Commit

Permalink
do not use netplan to create team0
Browse files Browse the repository at this point in the history
To avoid a bug a Netplan durring OVS cleanup step that reset the RSTP
configuration of the bridge that is already configured, we decided to
not use Netplan to create the team0 interface.

The team0 bridge is now created in anycase by the systemd-networkd.

Signed-off-by: Mathieu Dupré <[email protected]>
  • Loading branch information
dupremathieu committed Dec 4, 2024
1 parent 36d119b commit e37d8a0
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 45 deletions.
35 changes: 0 additions & 35 deletions inventories/netplan_cluster_example.yaml.j2

This file was deleted.

5 changes: 1 addition & 4 deletions inventories/seapath_cluster_definition_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ all:
netplan_configurations :
- inventories/netplan_admin_br0_example.yaml.j2
- inventories/netplan_ptp_interface_example.yaml.j2
- inventories/netplan_cluster_example.yaml.j2

# Main network configuration
network_interface: eno8303 #admin interface
Expand Down Expand Up @@ -60,7 +59,6 @@ all:
netplan_configurations :
- inventories/netplan_admin_br0_example.yaml.j2
- inventories/netplan_ptp_interface_example.yaml.j2
- inventories/netplan_cluster_example.yaml.j2

# Main network configuration
network_interface: eno8303
Expand Down Expand Up @@ -96,10 +94,9 @@ all:
ansible_host: 10.10.10.3
hostname: "node3"

netplan_configurations :
netplan_configurations:
- inventories/netplan_admin_br0_example.yaml.j2
- inventories/netplan_ptp_interface_example.yaml.j2
- inventories/netplan_cluster_example.yaml.j2

# Main network interface configuration
network_interface: eno8303
Expand Down
6 changes: 4 additions & 2 deletions playbooks/seapath_setup_network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
- standalone_machine
become: true
gather_facts: true
vars_files:
- ../vars/network_vars.yml
pre_tasks:
- name: Dynamically include network configuration variables
include_vars:
file: "../vars/network_{{ 'team_only_' if netplan_configurations is defined or (network_simple is defined and network_simple) else '' }}vars.yml"
roles:
- role: network_basics
- role: systemd_networkd
Expand Down
2 changes: 0 additions & 2 deletions roles/network_clusternetwork/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
when:
- cluster_protocol is not defined or cluster_protocol != "HSR" or hsr_mac_address is not defined
- skip_recreate_team0_config is not defined or skip_recreate_team0_config is not true
- netplan_configurations is not defined
- block:
- name: copy hsr.sh script
template:
Expand Down Expand Up @@ -71,4 +70,3 @@
state: restarted
when: hsr1.changed or hsr2.changed or hsr3.changed or hsrservice.changed
when: cluster_protocol is defined and cluster_protocol == "HSR" and hsr_mac_address is defined

29 changes: 29 additions & 0 deletions vars/network_team_only_vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (C) 2021, RTE (http://www.rte-france.com)
# Copyright (C) 2024 Savoir-faire Linux, Inc.
# SPDX-License-Identifier: Apache-2.0
---

systemd_networkd_network_custom: "{{ custom_network | default({}) }}"
systemd_networkd_netdev: "{{ custom_netdev | default({}) }}"

team0_systemd_networkd_network:
79-team0:
- Match:
- Name: "team0"
- Network:
- Address: "{{ cluster_ip_addr|default('0') }}/{{ team0subnet | default(24) }}"
79-team0_0:
- Match:
- Name: "{{ team0_0|default('0') }}"
- Link:
- MTUBytes: 1800
79-team0_1:
- Match:
- Name: "{{ team0_1|default('0') }}"
- Link:
- MTUBytes: 1800


systemd_networkd_network: "{{ team0_systemd_networkd_network | combine(systemd_networkd_network_custom) if cluster_ip_addr is defined else systemd_networkd_network_custom }}"

...
4 changes: 2 additions & 2 deletions vars/network_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# SPDX-License-Identifier: Apache-2.0
---

systemd_networkd_network_custom: "{{ custom_network | default([]) }}"
systemd_networkd_netdev_custom: "{{ custom_netdev | default([]) }}"
systemd_networkd_network_custom: "{{ custom_network | default({}) }}"
systemd_networkd_netdev_custom: "{{ custom_netdev | default({}) }}"

br0vlan_systemd_networkd_netdev:
79-br0:
Expand Down

0 comments on commit e37d8a0

Please sign in to comment.