Skip to content

Commit

Permalink
/vars/networks_vars.yml: add bridge configuration
Browse files Browse the repository at this point in the history
Update 'network_vars.yml' to incorporate bridge configuration options.

Signed-off-by: Benjamin Chedotel <[email protected]>
  • Loading branch information
bchedotel committed Feb 7, 2024
1 parent 0d17975 commit 4642cbb
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions vars/network_vars.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Copyright (C) 2021, RTE (http://www.rte-france.com)
# SPDX-License-Identifier: Apache-2.0
---
_systemd_networkd_network_custom: ["{{ custom_network |default([]) }}"]
_systemd_networkd_network_custom: ["{{ custom_network | default([]) }}"]
_systemd_networkd_netdev_custom: ["{{ custom_netdev | default([]) }}"]

_vlan_conditionnal: "{% if ptp_vlan is defined %}[{'VLAN': 'ptp'}]{% else %}[]{% endif %}"

Expand All @@ -16,5 +17,24 @@ _wired_systemd_networkd_network:
- Name: "{{ network_interface }}"
- Network: "{{ _network_common + _vlan_conditionnal }}"

_br0_systemd_networkd_netdev:
79-br0:
- NetDev:
- Name: "br0"
- Kind: "bridge"

_br0_systemd_networkd_network:
79-br0:
- Match:
- Name: "br0"
- Network:
- Gateway: "{{ gateway_addr }}"
- Address: "{{ ip_addr }}/{{ subnet | default(24) }}"
79-wired:
- Match:
- Name: "{{ network_interface }}"
- Network: "{{ [ {'Bridge': 'br0'} ] | default([]) }}"

systemd_networkd_network: "{{ _br0_systemd_networkd_network if use_br0_bridge is defined else _wired_systemd_networkd_network | combine(_systemd_networkd_network_custom) }}"
systemd_networkd_netdev: "{{ _br0_systemd_networkd_netdev if use_br0_bridge is defined else [] | combine(_systemd_networkd_netdev_custom)}}"

systemd_networkd_network: "{{ _wired_systemd_networkd_network | combine(_systemd_networkd_network_custom) }}"

0 comments on commit 4642cbb

Please sign in to comment.