-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As discussed at [1] the nmstatectl tool is going to be added to FCOS, it will allow to declare the network configuration at boot time [1] coreos/fedora-coreos-tracker#1175 Signed-off-by: Enrique Llorente <ellorent@redhat.com>
- Loading branch information
Showing
7 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
variant: fcos | ||
version: 1.4.0 | ||
storage: | ||
files: | ||
- path: /etc/nmstate/br-ex-policy.yaml | ||
overwrite: true | ||
contents: | ||
inline: | | ||
capture: | ||
default-gw-route: routes.running.destination=="0.0.0.0/0" | ||
default-gw-iface: interfaces.name==capture.default-gw-route.routes.running.0.next-hop-interface | ||
desiredState: | ||
interfaces: | ||
- name: "{{ capture.default-gw-iface.interfaces.0.name }}" | ||
description: configured by nmstatectl | ||
type: ethernet | ||
state: up | ||
- name: br-ex | ||
description: configured by nmstatectl | ||
type: ovs-interface | ||
copy-mac-from: "{{ capture.default-gw-iface.interfaces.0.name }}" | ||
state: up | ||
ipv4: | ||
enabled: true | ||
dhcp: true | ||
ipv6: | ||
enabled: true | ||
dhcp: true | ||
autoconf: true | ||
- name: br-ex | ||
description: ovs bridge with eth1 as a port configured by nmstatectl | ||
type: ovs-bridge | ||
state: up | ||
bridge: | ||
port: | ||
- name: br-ex | ||
- name: "{{ capture.default-gw-iface.interfaces.0.name }}" | ||
systemd: | ||
units: | ||
- name: nmstatectl.service | ||
enabled: true | ||
contents: | | ||
[Unit] | ||
Description=Nmstate apply | ||
After=network-online.target openvswitch.service | ||
Wants=network-online.target | ||
Requires=openvswitch.service | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=nmstatectl apply /etc/nmstate/br-ex.yaml | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
# | ||
# Configure an ovs-bridge using nmstate and butane | ||
|
||
set -xeuo pipefail | ||
|
||
. $KOLA_EXT_DATA/commonlib.sh | ||
|
||
if ! nmstatectl show; then | ||
fatal "ovs-bridge not configured" | ||
fi | ||
|
||
ok "ok ovs-bridge configured correctly with nmstate" | ||
|