Skip to content

Latest commit

 

History

History
1109 lines (545 loc) · 24.3 KB

REFERENCE.md

File metadata and controls

1109 lines (545 loc) · 24.3 KB

Reference

Table of Contents

Classes

  • network: Manage network devices
  • network::eth::bridge_packages: Include the required bridge packages
  • network::global: This sets up the global options in /etc/sysconfig/network See /usr/share/doc/initscripts-/sysconfig.txt for details of each option.
  • network::service: Contains all supported network management services
  • network::service::legacy: Restarts the network using a wrapper script that delays execution until after the Puppet agent run is finished. This ensures that network
  • network::service::network_manager: Restarts the network using a wrapper script that delays execution until after the Puppet agent run is finished. This ensures that network

Defined types

  • network::eth: This sets up a particular ethernet device config file. See /usr/share/doc/initscripts-/sysconfig.txt for details of each option. F
  • network::route: Add a static route to an interface. See /usr/share/doc/initscripts-*/sysconfig.txt for details of each option.

Data types

Classes

network

Manage network devices

Parameters

The following parameters are available in the network class:

auto_restart

Data type: Boolean

Restart the network if necessary due to a configuration change.

Default value: true

network::eth::bridge_packages

Include the required bridge packages

Parameters

The following parameters are available in the network::eth::bridge_packages class:

package_ensure

Data type: Simplib::PackageEnsure

The state to which the required packages should be set

Default value: simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' })

network::global

This sets up the global options in /etc/sysconfig/network

See /usr/share/doc/initscripts-/sysconfig.txt for details of each option.

Parameters

The following parameters are available in the network::global class:

gateway

Data type: Optional[Simplib::IP]

Default value: undef

gatewaydev

Data type: Optional[String]

Default value: undef

hostname

Data type: Simplib::Hostname

Default value: $facts['networking']['fqdn']

ipv6_autoconf

Data type: Optional[Boolean]

Default value: undef

ipv6_autotunnel

Data type: Optional[Boolean]

Default value: undef

ipv6_defaultdev

Data type: Optional[String]

Default value: undef

ipv6_defaultgw

Data type: Optional[String]

Default value: undef

ipv6_router

Data type: Optional[Boolean]

Default value: undef

ipv6forwarding

Data type: Optional[Boolean]

Default value: undef

network

Data type: Optional[Simplib::IP]

Default value: undef

networkdelay

Data type: Optional[Integer]

Default value: undef

networking

Data type: Optional[Boolean]

Default value: undef

networking_ipv6

Data type: Optional[Boolean]

Default value: undef

nisdomain

Data type: Optional[String]

Default value: undef

nozeroconf

Data type: Optional[Boolean]

Default value: undef

peerdns

Data type: Optional[Boolean]

Default value: undef

vlan

Data type: Optional[Boolean]

Default value: undef

auto_restart

Data type: Optional[Boolean]

Restart the network if necessary due to a configuration change.

Default value: $network::auto_restart

persistent_dhclient

Data type: Optional[Boolean]

Default value: undef

network::service

Contains all supported network management services

Parameters

The following parameters are available in the network::service class:

manage_legacy

Data type: Boolean

Enable management of the legacy 'network' service

Default value: true

manage_network_manager

Data type: Boolean

Enable management of the NetworkManager service

  • Defaults to the running active state of NetworkManager on the target system

Default value: pick(fact('simplib__networkmanager.enabled'), false)

network::service::legacy

Restarts the network using a wrapper script that delays execution until after the Puppet agent run is finished.

This ensures that network changes aren't applied during a Puppet agent run and potentially disrupt its other configurations and report (unless explicitly configured otherwise in specific network::eth declarations).

network::service::network_manager

Restarts the network using a wrapper script that delays execution until after the Puppet agent run is finished.

This ensures that network changes aren't applied during a Puppet agent run and potentially disrupt its other configurations and report (unless explicitly configured otherwise in specific network::eth declarations).

Parameters

The following parameters are available in the network::service::network_manager class:

puppet_agent_installed

Data type: Boolean

If puppet agent is running as service set this to true

Default value: false

Defined types

network::eth

This sets up a particular ethernet device config file.

See /usr/share/doc/initscripts-/sysconfig.txt for details of each option.

For bonding options see /usr/share/doc/iputils-20020927/README.bonding. Particularly, section "3.2 Configuration with Initscripts Support" and "2. Bonding Driver Options".

DEVICE is taken from $name HWADDR is pulled from facter if possible. ONBOOT is aliased to ONPARENT for alias devices

FIXME: This does require that you include 'network::redhat' to get the network service defined.

The following 3 options are passed as dhclientargs.

Parameters

The following parameters are available in the network::eth defined type:

name

DEVICE is taken from this variable.

auto_discover_mac

Data type: Boolean

Determine whether or not the system should try and auto-discover a MAC address for the interface specified.

Default value: true

bonding

Data type: Boolean

This variable does not translate into an init script option. If you set this to true instead of false any hardware address auto-discovery will be ignored. Otherwise, the interface will attempt to auto-discover the interface. If you explicitly set hwaddr or macaddr, then this will be ignored.

Default value: false

arp

Data type: Optional[Boolean]

Default value: undef

autoconnect_slaves

Data type: Optional[Boolean]

Default value: undef

bond_arp_interval

Data type: Optional[Integer]

Default value: undef

bond_arp_ip_target

Data type: Optional[Simplib::IP]

Default value: undef

bond_downdelay

Data type: Optional[Integer]

Default value: undef

bond_lacp_rate

Data type: Optional[Integer[0,1]]

Default value: undef

bond_max_bonds

Data type: Optional[Integer]

Default value: undef

bond_miimon

Data type: Optional[Integer]

Default value: undef

bond_mode

Data type: Optional[Network::BondMode]

Default value: undef

bond_primary

Data type: Optional[String]

Default value: undef

bond_updelay

Data type: Optional[Integer]

Default value: undef

bond_use_carrier

Data type: Optional[Integer[0,1]]

Default value: undef

bond_xmit_hash_policy

Data type: Optional[Network::TransmitPolicy]

Default value: undef

bootproto

Data type: Network::Eth::BootProto

Default value: 'dhcp'

bridge

Data type: Optional[String]

Default value: undef

broadcast

Data type: Optional[Simplib::IP]

Default value: undef

delay

Data type: Optional[Integer]

If hosting VMs, set delay to 0.

Default value: undef

dhclient_ignore_gateway

Data type: Optional[Boolean]

Default value: undef

dhclient_request_option_list

Data type: Optional[Array[String]]

Default value: undef

dhclient_timeout

Data type: Integer

Default value: 10080

dhclient_vendor_class_identifier

Data type: Optional[String[1]]

Default value: undef

dhcpclass

Data type: Optional[String[1]]

Default value: undef

dhcp_hostname

Data type: Optional[Simplib::Hostname]

Default value: undef

dhcprelease

Data type: Optional[String[1]]

Default value: undef

dns1

Data type: Optional[Simplib::Host]

Default value: undef

dns2

Data type: Optional[Simplib::Host]

Default value: undef

ethtool_opts

Data type: Optional[Array[String[1]]]

Default value: undef

ensure

Data type: Enum['absent','present']

Default value: 'present'

reorder_hdr

Data type: Optional[Boolean]

Default value: undef

gateway

Data type: Optional[Simplib::IP]

Default value: undef

hotplug

Data type: Optional[Boolean]

Default value: undef

hwaddr

Data type: Optional[Simplib::Macaddress]

If you set this, you have the following options:

  1. Leave Blank -> Auto-detect (default)
  2. Set to something with ':' -> Set to MAC address (if valid)
  3. Set to anything else -> Leave unset and add a comment

Default value: undef

ipaddr

Data type: Optional[Simplib::IP]

Default value: undef

ipv6_autoconf

Data type: Optional[Boolean]

Default value: undef

ipv6_control_radvd

Data type: Optional[Boolean]

Default value: undef

ipv6_mtu

Data type: Optional[Integer]

Default value: undef

ipv6_privacy

Data type: String[1]

Default value: 'rfc3041'

ipv6_radvd_pidfile

Data type: Optional[String[1]]

Default value: undef

ipv6_radvd_trigger_action

Data type: Optional[String[1]]

Default value: undef

ipv6_router

Data type: Optional[Boolean]

Default value: undef

ipv6addr

Data type: Optional[Simplib::IP::V6]

Default value: undef

ipv6addr_secondaries

Data type: Optional[Array[Simplib::IP::V6]]

Default value: undef

ipv6init

Data type: Optional[Boolean]

Default value: undef

ipv6to4_ipv4addr

Data type: Optional[String[1]]

Default value: undef

ipv6to4_mtu

Data type: Optional[Integer]

Default value: undef

ipv6to4_relay

Data type: Optional[String[1]]

Default value: undef

ipv6to4_routing

Data type: Optional[String[1]]

Default value: undef

ipv6to4init

Data type: Optional[Boolean]

Default value: undef

isalias

Data type: Optional[Boolean]

Default value: undef

linkdelay

Data type: Optional[Integer[1]]

Default value: undef

macaddr

Data type: Optional[Simplib::Macaddress]

If you set this variable, it will override any setting for $hwaddr!

Default value: undef

master

Data type: Optional[String[1]]

Default value: undef

metric

Data type: Optional[String[1]]

Default value: undef

mtu

Data type: Optional[Integer[1]]

Default value: undef

net_type

Data type: Optional[String[1]]

Default value: undef

netmask

Data type: Optional[Simplib::IP]

Default value: undef

network

Data type: Optional[Simplib::IP]

Default value: undef

nm_controlled

Data type: Boolean

EXPERIMENTAL feature to mark an interface as controlled by NetworkManager. If set, the code attempts a best-effort case to enable the interface and control it via the NetworkManager tools.

Default value: pick(fact('simplib__networkmanager.enabled'), false)

nozeroconf

Data type: Optional[String[1]]

Default value: undef

onboot

Data type: Boolean

Default value: true

peerdns

Data type: Optional[Boolean]

Default value: undef

physdev

Data type: Optional[String[1]]

Default value: undef

persistent_dhclient

Data type: Optional[Boolean]

Default value: undef

slave

Data type: Optional[Boolean]

Default value: undef

srcaddr

Data type: Optional[Simplib::IP]

Default value: undef

userctl

Data type: Optional[Boolean]

Default value: undef

vlan

Data type: Boolean

Default value: false

vlan_name_type

Data type: Optional[Network::VlanType]

Default value: undef

window

Data type: Optional[Integer[1]]

Default value: undef

auto_restart

Data type: Optional[Boolean]

Restart the network if necessary due to a configuration change.

  • Will use the value from the main network class if not set.

Default value: undef

network::route

Add a static route to an interface.

See /usr/share/doc/initscripts-*/sysconfig.txt for details of each option.

Examples

Defining a static route (Hiera)
eth0-1.1.1.1:
  interface: eth0
  next_hop: 8.8.8.8
  cidr_netmask: 1.1.1.1/32
  auto_restart: true # <- default
Defining multiple routes for the same interface (Puppet code)
network::route{ 'eth1-first-static-route':
  interface    => 'eth1',
  cidr_netmask => "192.168.1.0/24',
  next_hop     => '192.168.1.1,
}

network::route{ 'eth1-second-static-route':
  interface    => 'eth1',
  cidr_netmask => '192.168.3.0/24',
  next_hop     => '192.168.3.1',
}

Parameters

The following parameters are available in the network::route defined type:

interface

Data type: String

cidr_netmask

Data type: String

next_hop

Data type: Simplib::IP

auto_restart

Data type: Boolean

Restart the network if necessary due to a configuration change.

Default value: true

Data types

Network::BondMode

Valid bond modes for network interfaces

Alias of

Variant[Integer[0,6], Enum[
    'balance-rr',
    'active-backup',
    'balance-xor',
    'broadcast',
    '802.3ad',
    'balance-tlb',
    'balance-alb'
  ]]

Network::Eth::BootProto

Valid ethernet boot protocols

Alias of Enum['none', 'static', 'bootp', 'dhcp']

Network::TransmitPolicy

Valid network transmit policies

Alias of Enum['layer2', 'layer2+3', 'layer3+4']

Network::VlanType

taken from http://lxr.free-electrons.com/source/net/8021q/vlan.c?v=2.6.32#L310

Alias of Enum['VLAN_NAME_TYPE_RAW_PLUS_VID', 'VLAN_NAME_TYPE_PLUS_VID_NO_PAD', 'VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD', 'VLAN_NAME_TYPE_PLUS_VID']