cookbook 'systemd_networkd', '= 0.2.2'
systemd_networkd (11) Versions 0.2.2 Follow1
Configures systemd_networkd
cookbook 'systemd_networkd', '= 0.2.2', :supermarket
knife supermarket install systemd_networkd
knife supermarket download systemd_networkd
systemd_networkd Cookbook
This cookbook is responsible for configuring systemd-networkd.
A modified version of systemd networkd is required.
This can be found @ https://github.com/proxykillah/systemd
Requirements
-
systemd
- systemd_networkd required systemd > 216
Attributes
All keys are case sensitive. CamelCase is used instead of underscore.
Recipes
default: sets up directories and deletes old configurations
cpuport: configures attributes specific to cpu port
link: configures port state and port speed
static_mac_table: confgures the static MAC table (FDB)
switchport: configures port attributes
team: configures LAGs and LAG-specific features (e.g. LAG attributes)
ufd: configures uplink failure detection
Attributes
SystemdNetworkd
<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><tt>['SystemdNetworkd']['Backup']</tt></td>
<td>Boolean</td>
<td>whether or not to go into backup mode, typically used with chef solo, requires ohai plugin for inspection</td>
<td><tt>true</tt></td>
</tr>
<tr>
<td><tt>['SystemdNetworkd']['Teams']</tt></td>
<td>Object</td>
<td>Teams configuration</td>
<td><tt>{}</tt></td>
</tr>
<tr>
<td><tt>['SystemdNetworkd']['UFD']</tt></td>
<td>Object</td>
<td>Uplink failure detection configuration</td>
<td><tt>{}</tt></td>
</tr>
<tr>
<td><tt>['SystemdNetworkd']['Ports']</tt></td>
<td>Object</td>
<td>Ports configuration</td>
<td><tt>{}</tt></td>
</tr>
</table>
Usage
Just include systemd_networkd
in your node's run_list
:
Below is a fully working example of the relevant configuration options.
{ "name": "IES", "description": "Default role", "run_list": [ "recipe[systemd_networkd]" ], "default_attributes": { "SystemdNetworkd": { "Backup": false, "Teams": { "team1": { "Enabled": true, "Members": [ "sw0p9", "sw0p10" ], "Attributes": { "DefVlan": "1" }, "Vlans": { "lab": { "Id": "20", "EgressUntagged": "true" }, "office": { "Id": "25" } } } }, "UFD": { "sw0p1": { "Enabled": true, "BindCarrier": "sw0p2 sw0p3" }, "sw0p5": { "Enabled": true, "BindCarrier": "sw0p6 sw0p7 sw0p8 sw0p9" } }, "Ports": { "sw0p0": { "Attributes": { "LagMode": "1" }, "L2HashKey": { "UseL3Hash": "1" }, "L3HashConfig": { "UseTcp": "1" } }, "sw0p4": { "Enabled": true, "FDB": [ [ "MACAddress", "AB:BC:CC:00:01:02", "VLANId", "2" ], [ "MACAddress", "AB:BC:CC:00:01:02", "VLANId", "2" ], [ "MACAddress", "AB:BC:CC:00:01:02", "VLANId", "3" ] ], "Attributes": [ [ "Autoneg", "1" ] ] }, "sw0p5": { "Enabled": "false", "FDB": [ [ "MACAddress", "AB:BC:CC:00:01:02", "VLANId", "2" ], [ "MACAddress", "AB:BC:CC:00:01:03", "VLANId", "2" ], [ "MACAddress", "AB:BC:CC:00:01:03", "VLANId", "3" ] ], "Link": { "Link": [ [ "Duplex", "full" ], [ "BitsPerSecond", "10240000" ] ] } }, "sw0p6": { "Enabled": true, "FDB": [ [ "MACAddress", "AB:BC:CC:00:01:01", "VLANId", "2" ], [ "MACAddress", "AB:BC:CC:00:01:01", "VLANId", "2" ], [ "MACAddress", "AB:BC:CC:00:01:01", "VLANId", "3" ] ], "Vlans": { "lab": { "Id": "20", "EgressUntagged": "true" }, "office": { "Id": "25" } } } } } } }
Expected Output
```bash
[root@onpswitch-rr461 network]# pwd
/etc/systemd/network
[root@onpswitch-rr461 network]# tree
.
├── backup
├── cpuport
│ └── sw0p0.swport
├── link
│ ├── sw0p4.link
│ └── sw0p6.link
├── network
│ ├── sw0p4.network
│ └── sw0p6.network
├── sw0p0.swport -> /etc/systemd/network/cpuport/sw0p0.swport
├── sw0p4.link -> /etc/systemd/network/link/sw0p4.link
├── sw0p4.network -> /etc/systemd/network/network/sw0p4.network
├── sw0p4.swport -> /etc/systemd/network/switchport/sw0p4.swport
├── sw0p6.link -> /etc/systemd/network/link/sw0p6.link
├── sw0p6.network -> /etc/systemd/network/network/sw0p6.network
├── switchport
│ └── sw0p4.swport
├── team
│ ├── team_team1.netdev
│ ├── team_team1_sw0p10.network
│ ├── team_team1_sw0p9.network
│ └── team_team1.swport
├── team_team1.netdev -> /etc/systemd/network/team/team_team1.netdev
├── team_team1_sw0p10.network -> /etc/systemd/network/team/team_team1_sw0p10.network
├── team_team1_sw0p9.network -> /etc/systemd/network/team/team_team1_sw0p9.network
├── team_team1.swport -> /etc/systemd/network/team/team_team1.swport
├── ufd
│ ├── ufd_sw0p1.network
│ └── ufd_sw0p5.network
├── ufd_sw0p1.network -> /etc/systemd/network/ufd/ufd_sw0p1.network
└── ufd_sw0p5.network -> /etc/systemd/network/ufd/ufd_sw0p5.network
7 directories, 24 files
License and Authors
-------------------
Authors: David O Neill (david.m.oneill@intel.com)
Kim-marie Jones (kim-marie.jones@intel.com)
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
systemd_networkd CHANGELOG
0.2.2
- Numerous food critic fixes
0.2.1
- Added backup support
- fixed deprecations chef 11 - chef 12
0.2.0
- Cookbook redesign
- One cookbook for systemd_networkd configuration
0.1.3 (2015-04-01)
- Added uplink failure detection (UFD) support
- Added support for QOS attributes
- Added supuport configuration options
0.1.2 (2015-03-01)
- Added Team support
- Added vlan support for switchports
0.1.1 (2015-02-01)
- Added frame forwarding database (FDB / static mac table) support
- Added switchport support and port attributes
0.1.0 (2015-01-01)
- Initial release of systemd_networkd
Foodcritic Metric
0.2.2 failed this metric
FC002: Avoid string interpolation where not required: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/libraries/delete_config_files.rb:41
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/cpuport.rb:30
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/link.rb:37
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/link.rb:49
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/static_mac_table.rb:32
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/switchport.rb:32
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/team.rb:24
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/team.rb:35
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/team.rb:47
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/team.rb:61
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/ufd.rb:27
0.2.2 failed this metric
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/cpuport.rb:30
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/link.rb:37
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/link.rb:49
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/static_mac_table.rb:32
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/switchport.rb:32
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/team.rb:24
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/team.rb:35
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/team.rb:47
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/team.rb:61
FC033: Missing template: /tmp/cook/00458e5023ddabd85c8776d7/systemd_networkd/recipes/ufd.rb:27