Example 42 Puppet module to manage networking on Linux and Solaris.
- 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
- Backwards compatibility
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
This module configures networking on Linux and Solaris.
It manages hostname, interfaces, routes, rules and routing tables.
The new version (4) works only on Puppet 4 and later and has several changes in class and defines parameters.
Options to provide backwards compatibility are available in order to use the legacy versions of the module's defines.
Main class is used as entrypoint for general variables and wrapper for Hiera driven management of the provided defines.
Classes:
- network::hostname - Manages hostname
Defines:
- network::interface - Manages network interfaces
- network::route - Manages network routes
- network::routing_table - Manages iproute2 routing tables
- network::rule - Manages network rules
Legacy defines (inherited from version 3 of the module):
- network::legacy::interface - Manages network interfaces
- network::legacy::route - Manages network routes
- network::legacy::mroute - Manages network routes in an alternative, easier to handle, way
- network::legacy::routing_table - Manages iproute2 routing tables
- network::legacy::rule - Manages network rules
Puppetlabs-stdlib module is the only prerequisite module.
Puppet 4 or later is required for this module.
If you have earlier Puppet versions use code from the 3.x tags.
Include the main class to be able to manage via Hiera the network resources handled by the module:
include network
This does nothing by default, but allows to configure network resources with Hiera data like:
network::hostname: server.example.com
network::interfaces_hash:
eth0:
enable_dhcp: true
eth1:
ipaddress: '10.42.42.50'
netmask: '255.255.255.0'
network::routes_hash:
eth1:
routes:
99.99.228.0/24: eth0
100.100.244.0/22: 174.136.107.1
101.99.228.0/24: 'eth0 table 1'