-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for the `wait_ip` property, the system will consider connection activated only when specific IP stack is configured. This enables flexibility in scenarios such as IPv6-only networks, where the overall network configuration can still succeed when IPv4 configuration fails but IPv6 completes successfully. The `wait_ip` can be configured with the following possible values: * "any": System will consider interface activated when any IP stack is configured. * "ipv4": System will wait IPv4 been configured. * "ipv6": System will wait IPv6 been configured. * "ipv4+ipv6": System will wait both IPv4 and IPv6 been configured. Resolves: https://issues.redhat.com/browse/RHEL-63026 Signed-off-by: Wen Liang <[email protected]>
- Loading branch information
1 parent
38a61f7
commit d92baac
Showing
8 changed files
with
128 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
--- | ||
- name: Configuring wait_ip on ethernet connection | ||
hosts: all | ||
vars: | ||
network_connections: | ||
- name: eth0 | ||
state: up | ||
type: ethernet | ||
interface_name: eth0 | ||
ip: | ||
address: | ||
- 192.0.2.42/30 | ||
- 2001:db8::23/64 | ||
wait_ip: any | ||
|
||
roles: | ||
- linux-system-roles.network |
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,30 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
--- | ||
- name: Get ipv4.may-fail | ||
command: > | ||
nmcli -f ipv4.may-fail connection show {{ profile }} | ||
register: may_fail4 | ||
ignore_errors: true | ||
changed_when: false | ||
- name: Get ipv6.may-fail | ||
command: > | ||
nmcli -f ipv6.may-fail connection show {{ profile }} | ||
register: may_fail6 | ||
ignore_errors: true | ||
changed_when: false | ||
- name: "Assert that ipv4.may-fail is configured as specified" | ||
assert: | ||
that: | ||
- may_fail4.stdout.split(":")[1] | trim | ||
== "no" | ||
msg: "ipv4.may-fail is configured as | ||
{{ may_fail4.stdout.split(':')[1] | trim }} | ||
but wait_ip is specified as {{ wait_ip }}" | ||
- name: "Assert that ipv6.may-fail is configured as specified" | ||
assert: | ||
that: | ||
- may_fail6.stdout.split(":")[1] | trim | ||
== "no" | ||
msg: "ipv6.may-fail is configured as | ||
{{ may_fail6.stdout.split(':')[1] | trim }} | ||
but wait_ip is specified as {{ wait_ip }}" |
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
Oops, something went wrong.