- Description
- Setup - The basics of getting started with network
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
This module lets you manage network.
Classes:
Defined types:
Data types:
Facts:
This class manages a host's network configuration.
Name of the network domain.
Use 'legacy'
(default) or 'nm'
(NetworkManager) service.
The selected service is to be started at boot. Either true
(default) or false
.
The selected service is to be 'running'
(default) or 'stopped'
. Alternatively, a Boolean value may also be used with true
equivalent to 'running'
and false
equivalent to 'stopped'
.
A hash whose keys are interface names and whose values are hashes comprising the same parameters you would otherwise pass to the network::interface defined type.
An array of package names needed for a legacy network installation. The default should be correct for supported platforms.
The name of the legacy network service. The default should be correct for supported platforms.
The name of the Puppet provider to manage the legacy network service. The default should be correct for supported platforms.
An array of package names needed for a NetworkManager installation. The default should be correct for supported platforms.
The name of the NetworkManager service. The default should be correct for supported platforms.
Array of IP address strings that provide DNS address resolution. Typically not required for hosts with interfaces configured exclusively by DHCP. If set, this will cause the name resolver configuration to be managed.
Array of strings stating which network interface devices, if any, that NetworkManager is to leave unmanaged. The format for each is described in the section called "Device List Format" of NetworkManager.conf(5). This is ignored if service is 'legacy'
.
This class manages the packages required for wireless networking. It is included, as needed, by the network class.
An array of package names needed for a wireless network installation. The default should be correct for supported platforms.
This defined type manages a network interface configuration.
An arbitrary identifier for the instance unless the device parameter is not set in which case this must provide the value normally set with the device parameter.
The particular template to be used. Must be one of 'dhcp'
, 'dhcp-bridge'
, 'static'
, 'static-bridge'
or 'wireless'
. The 'wireless'
template assumes a DHCP configuration and is only supported when $network::service
is 'nm'
(NetworkManager).
Instance is to be 'present'
(default) or 'absent'
.
Name of the associated bridge interface, if any. Ignored when template is one of 'dhcp-bridge'
, 'static-bridge'
or 'wireless'
.
Country code for CRDA when template is 'wireless'
. Ignored for all other templates.
Name of the device interface, e.g., 'eth0'
or 'wlan0'
. This may be used in place of namevar if it's beneficial to give namevar an arbitrary value.
Extended Service Set Identification (ESSID) of the wireless network. Required when template is 'wireless'
and ignored for all others.
Any device-specific options supported by ethtool
's -K
option expressed as a simple string passed along unmodified. E.g., 'gso off'
.
The default route IP address to be assigned to the interface. Recommended when template is 'static'
or 'static-bridge'
and ignored for all others.
The IP address to be assigned to the interface. Required when template is 'static'
or 'static-bridge'
. Optional when template is 'dhcp'
(to allow both a dynamic and static addresses concurrently). Ignored for all other values.
Key management method for wireless encryption. Must be one of 'WPA-PSK'
(default) or ???. Required when template is 'wireless'
and ignored for all others.
The MAC address to be assigned to the interface. This is not used for identifying/matching a physical interface but rather to override what the manufacturer assigned.
Metric for the default route specified by gateway. The default is whatever the iproute2 package assigns, usually (always?) 100
.
Wireless mode. Must be one of 'Managed'
(default, also known as infrastructure mode) or ???. Required when template is 'wireless'
and ignored for all others.
The network mask for this interface. Required when template is 'static'
or 'static-bridge'
. Optional when template is 'dhcp'
(to allow both a dynamic and static addresses concurrently). Ignored for all other values.
Use the name servers provided by DHCP? Either true
(default) or false
. Ignored when template is 'static'
or 'static-bridge'
.
Use the time servers provided by DHCP? Either true (default) or false. Ignored when template is 'static'
or 'static-bridge'
.
Should the DHCP client persist attempting to gain a lease if it encounters continual failure? Either true
(default) or false
. Ignored when template is 'static'
or 'static-bridge'
.
Pre-shared key for wireless encryption. Required when template is 'wireless'
and ignored for all others.
Static routes for this interface expressed as a hash whose keys are arbitrary and may be used to describe each route. The corresponding value for each such key must be another hash whose keys must include 'address'
and 'netmask'
with strings providing the appropriate values to define the route. This same hash may also include gateway
, metric
and options
to further define the static route. The default is to have no static routes.
Enable the Spanning Tree Protocol (STP)? Either true
(default) or false
. Ignored unless template is 'static-bridge'
.
If set with a VLAN ID, this interface will tag all outbound packets with this ID and only accept packets tagged with this ID. Valid IDs range from 1 to 4094.
This alone does not affect the name of the interface so it is necessary to make the tagged interface distinct from the base interface. One common convention is to set namevar so that its the base interface name followed by a dot followed by the VLAN ID, e.g., 'eth0.123'
.
Matches acceptable values for the template parameter of the network::interface defined type.
Matches acceptable values for a VLAN ID, specifically a positive integer no less than 1 and no greater than 4094. This also accepts a string so long as the value matches the same restrictions.
Tested on modern Fedora and CentOS releases, but likely to work on any Red Hat variant. Adaptations for other operating systems should be trivial as this module follows the data-in-module paradigm. See data/common.yaml
for the most likely obstructions. If "one size can't fit all", the value should be moved from data/common.yaml
to data/os/%{facts.os.name}.yaml
instead. See hiera.yaml
for how this is handled.
Contributions are welcome via pull requests. All code should generally be compliant with puppet-lint.