forked from coreos/fedora-coreos-config
-
Notifications
You must be signed in to change notification settings - Fork 0
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
12 changed files
with
106 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
. $KOLA_EXT_DATA/commonlib.sh | ||
|
||
run-checks() { | ||
local prefix=$1 | ||
if ! nmcli c show br-ex ; then | ||
nmstatectl show | ||
journalctl -u nmstate | ||
fatal "${prefix}: bridge not configured" | ||
fi | ||
ok "${prefix}: bridge configured correctly" | ||
} | ||
|
||
main() { | ||
case "${AUTOPKGTEST_REBOOT_MARK:-}" in | ||
"") | ||
run-checks "first boot" | ||
/tmp/autopkgtest-reboot rebooted | ||
;; | ||
|
||
rebooted) | ||
run-checks "second boot" | ||
if ! ls /etc/nmstate/*applied; then | ||
fatal "nmstate yamls files not marked as applied" | ||
fi | ||
;; | ||
*) fatal "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}";; | ||
esac | ||
} |
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,24 @@ | ||
variant: fcos | ||
version: 1.4.0 | ||
storage: | ||
files: | ||
- path: /etc/nmstate/br-ex-policy.yml | ||
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 }}" | ||
type: ethernet | ||
state: up | ||
- name: br-ex | ||
type: linux-bridge | ||
copy-mac-from: "{{ capture.default-gw-iface.interfaces.0.name }}" | ||
state: up | ||
ipv4: "{{ capture.default-gw-iface.interfaces.0.ipv4 }}" | ||
ipv6: "{{ capture.default-gw-iface.interfaces.0.ipv6 }}" | ||
bridge: | ||
port: | ||
- name: "{{ capture.default-gw-iface.interfaces.0.name }}" |
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 @@ | ||
../../../data/commonlib.sh |
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 @@ | ||
../../data/nmstate-common.sh |
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,11 @@ | ||
#!/bin/bash | ||
## kola: | ||
## tags: "platform-independent" | ||
# | ||
# Configure a DHCP linux bridge using butane and nmstate service with policy | ||
|
||
set -xeuo pipefail | ||
|
||
. $KOLA_EXT_DATA/nmstate-common.sh | ||
|
||
main |
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,17 @@ | ||
variant: fcos | ||
version: 1.4.0 | ||
storage: | ||
files: | ||
- path: /etc/nmstate/br-ex.yml | ||
contents: | ||
inline: | | ||
interfaces: | ||
- name: br-ex | ||
type: linux-bridge | ||
state: up | ||
ipv4: | ||
enabled: false | ||
ipv6: | ||
enabled: false | ||
bridge: | ||
port: [] |
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 @@ | ||
../../../data/commonlib.sh |
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 @@ | ||
../../data/nmstate-common.sh |
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,11 @@ | ||
#!/bin/bash | ||
## kola: | ||
## tags: "platform-independent" | ||
# | ||
# Configure a DHCP linux bridge using butane and nmstate service with state | ||
|
||
set -xeuo pipefail | ||
|
||
. $KOLA_EXT_DATA/nmstate-common.sh | ||
|
||
main |