-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introducing NetworkManager/system-connections
EL9 (almalinux,centos,rhel,rocky) have changed where the default storage of network-configuration files. And also the format, from old network-scripts to NetworkManager keyfiles. These new templates implement (atleast partial) functionality of network-scripts in NetworkManager keyfile style. https://www.redhat.com/en/blog/rhel-9-networking-say-goodbye-ifcfg-files-and-hello-keyfiles
- Loading branch information
Showing
11 changed files
with
289 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# {{ ansible_managed }} | ||
|
||
[connection] | ||
id={{ item.device }} | ||
type=bond | ||
interface-name={{ item.device }} | ||
{% if item.zone is defined %} | ||
zone={{ item.zone }} | ||
{% endif %} | ||
|
||
{% for bridge in interfaces_bridge_interfaces %} | ||
{% if item.device in bridge.ports %} | ||
master={{ bridge.device }} | ||
slave-type=bridge | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{% if item.mtu is defined %} | ||
[ethernet] | ||
mtu={{ item.mtu }} | ||
{% endif %} | ||
|
||
[bond] | ||
{% if item.bond_ad_select is defined %} | ||
ad_select={{ item.bond_ad_select }} | ||
{% endif %} | ||
{% if item.bond_downdelay is defined %} | ||
downdelay={{ item.bond_downdelay }} | ||
{% endif %} | ||
{% if item.bond_lacp_rate is defined %} | ||
lacp_rate={{ item.bond_lacp_rate }} | ||
{% endif %} | ||
miimon={{ item.bond_miimon | default(100) }} | ||
{% if item.bond_mode is defined %} | ||
mode={{ item.bond_mode }} | ||
{% endif %} | ||
{% if item.bond_updelay is defined %} | ||
updelay={{ item.bond_updelay }} | ||
{% endif %} | ||
{% if item.bond_xmit_hash_policy is defined %} | ||
xmit_hash_policy={{ item.bond_xmit_hash_policy }} | ||
{% endif %} | ||
|
||
[ipv4] | ||
{% if item.bootproto == 'dhcp' %} | ||
method=auto | ||
{% elif item.bootproto == 'static' and item.address is defined and item.address | length %} | ||
method=manual | ||
{% if item.netmask is defined %} | ||
address1={{ (item.address ~'/'~ item.netmask) | ipaddr('host/prefix') }} | ||
{% endif %} | ||
{% if item.gateway is defined and item.gateway | length %} | ||
gateway={{ item.gateway }} | ||
{% endif %} | ||
{% else %} | ||
method=disabled | ||
{% endif %} | ||
{% if item.route is defined %} | ||
{% for i in item.route %} | ||
{% if 'gateway' in i %} | ||
route{{ loop.index }}={{ (i.network ~'/'~ i.netmask) | ipaddr('network/prefix') }},{{ i.gateway }} | ||
{% endif %} | ||
{# TODO: dev, table, options #} | ||
{% endfor %} | ||
{% endif %} | ||
{% if item.dnsnameservers is defined %} | ||
dns={{ item.dnsnameservers | join(',') }} | ||
{% endif %} | ||
|
||
[ipv6] | ||
{% if item.ip6 is defined %} | ||
method={{ (item.bootproto == 'static') | ternary('manual', 'auto') }} | ||
{% if item.ip6.address is defined and item.ip6.netmask is defined %} | ||
address1={{ (item.ip6.address ~'/'~ item.ip6.netmask) | ipaddr('host/prefix') }} | ||
{% endif %} | ||
{% if item.ip6.gateway is defined %} | ||
gateway={{ item.ip6.gateway }} | ||
{% endif %} | ||
{% if item.ip6.route is defined %} | ||
{% for i in item.ip6.route %} | ||
{% if 'gateway' in i %} | ||
route{{ loop.index }}={{ (i.network ~'/'~ i.netmask) | ipaddr('network/prefix') }},{{ i.gateway }} | ||
{% endif %} | ||
{# TODO: dev, table, options #} | ||
{% endfor %} | ||
{% endif %} | ||
{% else %} | ||
method=disabled | ||
{% endif %} |
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,9 @@ | ||
# {{ ansible_managed }} | ||
|
||
[connection] | ||
id={{ item.1 }} | ||
type=ethernet | ||
interface-name={{ item.1 }} | ||
|
||
master={{ item.0.device }} | ||
slave-type=bond |
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,67 @@ | ||
# {{ ansible_managed }} | ||
|
||
[connection] | ||
id={{ item.device }} | ||
type=bridge | ||
interface-name={{ item.device }} | ||
{% if item.zone is defined %} | ||
zone={{ item.zone }} | ||
{% endif %} | ||
|
||
{% if item.mtu is defined %} | ||
[ethernet] | ||
mtu={{ item.mtu }} | ||
{% endif %} | ||
|
||
[bridge] | ||
interface-name={{ item.device }} | ||
{% if item.stp is defined %} | ||
stp={{ item.stp }} | ||
{% endif %} | ||
|
||
[ipv4] | ||
{% if item.bootproto == 'dhcp' %} | ||
method=auto | ||
{% elif item.bootproto == 'static' and item.address is defined and item.address | length %} | ||
method=manual | ||
{% if item.netmask is defined %} | ||
address1={{ (item.address ~'/'~ item.netmask) | ipaddr('host/prefix') }} | ||
{% endif %} | ||
{% if item.gateway is defined and item.gateway | length %} | ||
gateway={{ item.gateway }} | ||
{% endif %} | ||
{% else %} | ||
method=disabled | ||
{% endif %} | ||
{% if item.route is defined %} | ||
{% for i in item.route %} | ||
{% if 'gateway' in i %} | ||
route{{ loop.index }}={{ (i.network ~'/'~ i.netmask) | ipaddr('network/prefix') }},{{ i.gateway }} | ||
{% endif %} | ||
{# TODO: dev, table, options #} | ||
{% endfor %} | ||
{% endif %} | ||
{% if item.dnsnameservers is defined %} | ||
dns={{ item.dnsnameservers | join(',') }} | ||
{% endif %} | ||
|
||
[ipv6] | ||
{% if item.ip6 is defined %} | ||
method={{ (item.bootproto == 'static') | ternary('manual', 'auto') }} | ||
{% if item.ip6.address is defined and item.ip6.netmask is defined %} | ||
address1={{ (item.ip6.address ~'/'~ item.ip6.netmask) | ipaddr('host/prefix') }} | ||
{% endif %} | ||
{% if item.ip6.gateway is defined %} | ||
gateway={{ item.ip6.gateway }} | ||
{% endif %} | ||
{% if item.ip6.route is defined %} | ||
{% for i in item.ip6.route %} | ||
{% if 'gateway' in i %} | ||
route{{ loop.index }}={{ (i.network ~'/'~ i.netmask) | ipaddr('network/prefix') }},{{ i.gateway }} | ||
{% endif %} | ||
{# TODO: dev, table, options #} | ||
{% endfor %} | ||
{% endif %} | ||
{% else %} | ||
method=disabled | ||
{% endif %} |
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,21 @@ | ||
# {{ ansible_managed }} | ||
|
||
[connection] | ||
id={{ item.1 }} | ||
type={{ (item.1 is match(vlan_interface_regex)) | ternary('vlan', 'ethernet') }} | ||
interface-name={{ item.1 }} | ||
|
||
master={{ item.0.device }} | ||
slave-type=bridge | ||
|
||
{% if item.0.mtu is defined %} | ||
[ethernet] | ||
mtu={{ item.0.mtu }} | ||
{% endif %} | ||
|
||
{% if item.1 is match(vlan_interface_regex) %} | ||
[vlan] | ||
interface-name={{ item.1 }} | ||
parent={{ item.1 | regex_replace(vlan_interface_regex, '\g<interface>') }} | ||
id={{ item.1 | regex_replace(vlan_interface_regex, '\g<vlan_id>') }} | ||
{% endif %} |
Oops, something went wrong.