Skip to content

Commit

Permalink
seapath_setup_network: 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 5, 2024
1 parent e9828a1 commit 431fc74
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 61 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: 5 additions & 1 deletion playbooks/seapath_setup_network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
become: true
gather_facts: true
vars_files:
- ../vars/network_vars.yml
- "../vars/network_team0.yml"
pre_tasks:
- name: Dynamically include network configuration variables
include_vars:
file: "../vars/network_{{ 'empty' if netplan_configurations is defined or (network_simple is defined and network_simple) else 'defaults' }}.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

22 changes: 3 additions & 19 deletions vars/network_vars.yml → vars/network_defaults.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# 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: "{{ 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 Expand Up @@ -64,22 +65,5 @@ wired_systemd_networkd_network: "{{ br0vlan_systemd_networkd_network if br0vlan
systemd_networkd_netdev_nocluster: "{{ wired_systemd_networkd_netdev | combine(systemd_networkd_netdev_custom) }}"
systemd_networkd_network_nocluster: "{{ wired_systemd_networkd_network | combine(systemd_networkd_network_custom) }}"

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: "{{ systemd_networkd_network_nocluster|combine(team0_systemd_networkd_network) if cluster_ip_addr is defined else systemd_networkd_network_nocluster}}"
systemd_networkd_netdev: "{{ systemd_networkd_netdev_nocluster }}"
11 changes: 11 additions & 0 deletions vars/network_empty.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 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({}) }}"

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

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

---

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

...

0 comments on commit 431fc74

Please sign in to comment.