-
-
Notifications
You must be signed in to change notification settings - Fork 107
Implement a NetworkManager provider using nmstate #347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
silug
wants to merge
10
commits into
voxpupuli:master
Choose a base branch
from
silug:nmstate
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c021bc7
Add documentation for openvox-strings
silug 27160c9
Implement a NetworkManager provider using nmstate
silug dc175c4
Cleanup
silug 11f5819
Also add network_route provider
silug 9d2eef5
Add acceptance tests
silug 8680ffa
Fix $ipaddress data type
silug ac36e43
Fixes for beaker tests
silug b735cb0
More fixes
silug acbf296
Additional fixes
silug 1cd9221
Fix `defaultfor` for the old redhat provider
silug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -13,6 +13,73 @@ | |
|
|
||
| Manage non-volatile network and route configuration. | ||
|
|
||
| This module supports multiple providers for different network management systems: | ||
|
|
||
| - **interfaces** - Debian/Ubuntu style `/etc/network/interfaces` | ||
| - **redhat** - Red Hat Enterprise Linux network scripts in `/etc/sysconfig/network-scripts/` | ||
| - **sles** - SUSE Linux Enterprise network scripts in `/etc/sysconfig/network/` | ||
| - **nm** - NetworkManager using nmstate (requires `nmstatectl` command) | ||
|
|
||
| The NetworkManager provider (`nm`) uses [nmstate](https://nmstate.io/) to provide declarative network configuration through NetworkManager. This provider is ideal for modern Linux distributions that use NetworkManager as their primary network management service. | ||
|
|
||
| ### NetworkManager (nm) Provider | ||
|
|
||
| The NetworkManager provider uses nmstate to apply network configuration changes. It requires: | ||
|
|
||
| - NetworkManager service running | ||
| - `nmstatectl` command available (from the `nmstate` package) | ||
|
|
||
| This provider supports all standard `network_config` properties and includes additional features: | ||
|
|
||
| - Automatic interface type detection (ethernet, wifi, bond, bridge, vlan) | ||
| - Hot-plugging and reconfiguration support | ||
| - Provider-specific options for advanced NetworkManager features | ||
| - IPv4 and IPv6 support including static, DHCP, and manual configurations | ||
|
|
||
| Example usage with NetworkManager provider: | ||
|
|
||
| ```puppet | ||
| # Force use of NetworkManager provider | ||
| network_config { 'eth0': | ||
| ensure => 'present', | ||
| provider => 'nm', | ||
| family => 'inet', | ||
| method => 'static', | ||
| ipaddress => '192.168.1.100', | ||
| netmask => '255.255.255.0', | ||
| onboot => 'true', | ||
| mtu => 1500, | ||
| options => { | ||
| 'ethernet' => { | ||
| 'auto-negotiation' => false, | ||
| 'speed' => 1000, | ||
| 'duplex' => 'full' | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # DHCP configuration with NetworkManager | ||
| network_config { 'eth1': | ||
| ensure => 'present', | ||
| provider => 'nm', | ||
| family => 'inet', | ||
| method => 'dhcp', | ||
| onboot => 'true', | ||
| } | ||
|
|
||
| # IPv6 static configuration | ||
| network_config { 'eth2': | ||
| ensure => 'present', | ||
| provider => 'nm', | ||
| family => 'inet6', | ||
| method => 'static', | ||
| ipaddress => '2001:db8::1', | ||
| netmask => '64', | ||
| onboot => 'true', | ||
| reconfigure => 'true', | ||
| } | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| Interface configuration | ||
|
|
@@ -138,6 +205,27 @@ Create resources on the fly with the `puppet resource` command: | |
| This module requires the FileMapper mixin, available at <https://github.com/voxpupuli/puppet-filemapper>. | ||
| The network_config type requires the Boolean mixin, available at <https://github.com/adrienthebo/puppet-boolean>. | ||
|
|
||
| ### NetworkManager Provider Dependencies | ||
|
|
||
| The NetworkManager (`nm`) provider requires: | ||
|
|
||
| - NetworkManager service running | ||
| - `nmstate` package installed (provides `nmstatectl` command) | ||
|
|
||
| On RHEL/CentOS/Fedora: | ||
| ```bash | ||
| dnf install nmstate | ||
| # or | ||
| yum install nmstate | ||
| ``` | ||
|
|
||
| On Debian/Ubuntu: | ||
| ```bash | ||
| apt-get install nmstate | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on what Ubuntu or Debian versions does this work? |
||
| ``` | ||
|
|
||
| ### Other Provider Dependencies | ||
|
|
||
| The debian routes provider requires the package [ifupdown-extra](http://packages.debian.org/search?suite=all§ion=all&arch=any&searchon=names&keywords=ifupdown-extra). | ||
| `ifupdown-extra` can be installed automatically using the `network` class. | ||
| To use it, include it like so in your manifests: | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the changelog for vox pupuli modules is generated based on closed issues and PRs, on each release. Please don't edit it manually, it will be overwritten.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, that's Copilot cruft. I'll clean it up before I submit this for real.