https://github.com/bibigon812/bibigon812-network
Puppet module for network management in Linux.
https://github.com/bibigon812/bibigon812-network
bond centos network puppet-module vlan
Last synced: about 1 month ago
JSON representation
Puppet module for network management in Linux.
- Host: GitHub
- URL: https://github.com/bibigon812/bibigon812-network
- Owner: bibigon812
- Created: 2017-07-24T14:48:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-17T07:26:29.000Z (over 8 years ago)
- Last Synced: 2025-10-21T02:50:03.135Z (6 months ago)
- Topics: bond, centos, network, puppet-module, vlan
- Language: Ruby
- Homepage: https://forge.puppet.com/bibigon812/network/
- Size: 135 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# network
[](https://travis-ci.org/bibigon812/bibigon812-network)
## Description
This module manages network interfaces without restarting the network
subsystem. It contains of two parts. One uses iproute2 tools and system files
placed in `/sys/class/net`. The other manages files needed to restore the state
after OS boots.
## Naming convention
- Ethernet: `/\A([[:alpha:]]*([[:alpha:]]\d+)+)\Z/`. Examples: `enp0s1`, `ens0f1`.
- Bonding: `/\Abond\d+\Z/`. Examples: `bond0`, `bond1`.
- Vlan: `/\Avlan(\d+)\Z/`, `$1` - vlanid. Examples: `vlan10`, `vlan100`.
- Loopback: `/\Alo\Z/`. Examples: `lo`.
## Setup
### Limitations
* Manages alias files only for ten ip addresses.
### What network affects
* Removes unspecified IP addresses of the network interface.
* Overwrites configuration files of the network interface.
* Can make your server unreachable.
### Beginning with network
Include this module and write hiera.
```puppet
include ::network
```
```yaml
---
network::network_manager::enable: false
network::network_manager::ensure: stopped
```
```yaml
---
network::interfaces:
eth0:
mtu: 9000
eth1:
mtu: 9000
bond0:
bond_slaves:
- eth0
- eth1
mtu: 9000
valn100:
ipaddress:
- 10.0.0.1/24
- 172.16.0.1/24
mtu: 1500
parent: bond0
vlan110:
ipaddress:
- 192.168.255.1/24
mtu: 9000
parent: bond0
---
network::routes:
192.168.0.0/24:
device: vlan100
nexthop: 172.16.0.100
192.168.0.0/24 100:
device: vlan110
nexthop: 192.168.255.100
```
## Usage
```puppet
network_interface { ['eth0', 'eth1']:
mtu => 9000,
}
```
```yaml
---
network::interfaces:
eth0:
mtu: 9000
eth1:
mtu: 9000
```
### Create the bond interface
```puppet
network_interface { 'bond0':
ensure => present,
bond_lacp_rate => 'fast',
bond_slaves => [
'eth0',
'eth1',
],
mtu => 9000,
}
```
```yaml
---
network::interfaces:
bond0:
ensure: present
bond_lacp_rate: fast
bond_slaves:
- eth0
- eth1
mtu: 9000
```
### Create the vlan interface
```puppet
network_interface { 'bond0.100':
ensure => present,
ipaddress => [
'10.0.0.1/24',
'172.16.0.1/24',
],
}
```
```yaml
---
network::interfaces:
bond0.100:
ipaddress:
- 10.0.0.1/24
- 172.16.0.1/24
```
```puppet
network_interface { 'vlan100':
ensure => present,
ipaddress => [
'10.0.0.1/24',
'172.16.0.1/24',
],
parent => 'bond0',
}
```
```yaml
---
network::interfaces:
vlan100:
ipaddress:
- 10.0.0.1/24
- 172.16.0.1/24
parent: bond0
```
### Create routes
```puppet
network_route { '192.168.0.0/24':
ensure => present,
device => 'vlan100',
nexthop => '10.0.0.100',
}
```
```yaml
network::routes:
192.168.0.0/24:
ensure: present
device: vlan100
nexthop: 10.0.0.100
```
```puppet
network_route { '10.0.0.0/24 250':
ensure => present,
device => 'vlan200',
}
```
```yaml
network::route:
10.0.0.0/24 250:
ensure: present
device: vlan200
```
## Reference
### network_interface
- `name`. Interface name.
- `type`. Interface type. Can be `hw`, `bond` and `vlan`.
- `bond_lacp_rate`. Option specifying the rate in which we'll ask our link
partner to transmit LACPDU packets in 802.3ad mode. Defaults to `slow`.
- `bond_miimon`. Specifies the MII link monitoring frequency in milliseconds.
Defaults to `100`.
- `bond_mode`. Specifies one of the bonding policies. Defaults to `802.3ad`.
- `bond_slaves`. Specifies a list of the bonding slaves. Defaults to `[]`.
- `bond_xmit_hash_policy`. This policy uses upper layer protocol information,
when available, to generate the hash. Defaults to `layer3+4`.
- `ipaddress`. Specifies a list of IP addresses. Defaults to `[]`.
- `mac`. Specifies a MAC address.
- `mtu`. Specifies the maximum transmission unit.
- `parent`. Specifies a parent interface.
- `state`. State of this interface. Can be `up` and `down`. Defaults to `up`.
- `vlanid`. Vlan ID.
### network_route
- `name`. Contains the IP prefix and the metric (optional).
- `prefix`. Specifies the IP prefix. The default value obtains from the name.
- `metric`. Specifies the metric. The default value obtains rom the name.
- `device`. Specifies the device.
- `nexthop`. Specifies the next hop.