-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add possibility to manage network interfaces with a template
- Loading branch information
Showing
94 changed files
with
3,731 additions
and
3 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe 'systemd::networkd' do | ||
on_supported_os.each do |os, os_facts| | ||
context "on #{os}" do | ||
let(:facts) { os_facts } | ||
let(:pre_condition) do | ||
[ | ||
'include systemd', | ||
# Fake assert_private function from stdlib to not fail within this test | ||
'function assert_private () { }', | ||
] | ||
end | ||
|
||
it { is_expected.to compile.with_all_deps } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe 'Systemd::Interface::Link' do | ||
describe 'valid types' do | ||
context 'with valid types' do | ||
[ | ||
{}, | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.to allow_value(value) } | ||
end | ||
end | ||
end | ||
end | ||
|
||
describe 'invalid types' do | ||
context 'with garbage inputs' do | ||
[ | ||
true, | ||
false, | ||
:keyword, | ||
nil, | ||
{ 'foo' => 'bar' }, | ||
'42', | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.not_to allow_value(value) } | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe 'Systemd::Interface::Netdev' do | ||
describe 'valid types' do | ||
context 'with valid types' do | ||
[ | ||
{}, | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.to allow_value(value) } | ||
end | ||
end | ||
end | ||
end | ||
|
||
describe 'invalid types' do | ||
context 'with garbage inputs' do | ||
[ | ||
true, | ||
false, | ||
:keyword, | ||
nil, | ||
{ 'foo' => 'bar' }, | ||
'42', | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.not_to allow_value(value) } | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe 'Systemd::Interface::Network' do | ||
describe 'valid types' do | ||
context 'with valid types' do | ||
[ | ||
{}, | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.to allow_value(value) } | ||
end | ||
end | ||
end | ||
end | ||
|
||
describe 'invalid types' do | ||
context 'with garbage inputs' do | ||
[ | ||
true, | ||
false, | ||
:keyword, | ||
nil, | ||
{ 'foo' => 'bar' }, | ||
'42', | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.not_to allow_value(value) } | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe 'Systemd::Interface' do | ||
describe 'valid types' do | ||
context 'with valid types' do | ||
[ | ||
{}, | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.to allow_value(value) } | ||
end | ||
end | ||
end | ||
end | ||
|
||
describe 'invalid types' do | ||
context 'with garbage inputs' do | ||
[ | ||
true, | ||
false, | ||
:keyword, | ||
nil, | ||
{ 'foo' => 'bar' }, | ||
'42', | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.not_to allow_value(value) } | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<%- | String[1] $fname = {}, | ||
Hash $config = {}, | ||
| -%> | ||
# | ||
# This file is managed with puppet | ||
# | ||
# File name: <%= $fname %> | ||
# | ||
<% $config.each |String $head, Variant[Hash,Array] $vals| { -%> | ||
<%- if $vals =~ Array { $_loop= $vals } else { $_loop = [ $vals ] } -%> | ||
<%- $_loop.each | Hash $vals | { -%> | ||
|
||
<%- %>[<%= $head %>] | ||
<%- $vals.each() | String $key, Any $value | { -%> | ||
<%- if $value =~ Array[String] { -%> | ||
<%- $value.each() | String $val | { -%> | ||
<%- %><%= $key %>=<%= $val %> | ||
<%- } -%> | ||
<%- } else { -%> | ||
<%- if $value !~ Undef { -%> | ||
<%- %><%= $key %>=<%= $value %> | ||
<%- } -%> | ||
<%- } -%> | ||
<%- } -%> | ||
<%- } -%> | ||
<% } -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# network interface definition | ||
type Systemd::Interface = Struct[{ | ||
filename => Optional[String[1]], | ||
network => Optional[Systemd::Interface::Network], | ||
netdev => Optional[Systemd::Interface::Netdev], | ||
link => Optional[Systemd::Interface::Link], | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# interface definition | ||
type Systemd::Interface::Link = Struct[{ | ||
'Match' => Optional[Systemd::Interface::Link::Match], | ||
'Link' => Optional[Systemd::Interface::Link::Link], | ||
'SR-IOV' => Optional[Systemd::Interface::Link::Sr_iov], | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# interface definition | ||
type Systemd::Interface::Link::Link = Struct[{ | ||
'Description' => Optional[String[1]], | ||
'Property' => Optional[String[1]], | ||
'ImportProperty' => Optional[String[1]], | ||
'UnsetProperty' => Optional[String[1]], | ||
'Alias' => Optional[String[1]], | ||
'MACAddressPolicy' => Optional[Enum['persistent', 'random', 'none', '']], | ||
'MACAddress' => Optional[String[1]], | ||
'NamePolicy' => Optional[Enum[ | ||
'kernel', 'database', 'onboard', 'slot', | ||
'path', 'mac', 'keep' | ||
]], | ||
'Name' => Optional[String[1]], | ||
'AlternativeNamesPolicy' => Optional[String[1]], | ||
'AlternativeName' => Optional[String[1]], | ||
'TransmitQueues' => Optional[Integer[1,4096]], | ||
'ReceiveQueues' => Optional[Integer[1,4096]], | ||
'TransmitQueueLength' => Optional[Integer[0, 4294967294]], | ||
'MTUBytes' => Optional[Integer[1280]], | ||
'BitsPerSecond' => Optional[String[1]], | ||
'Duplex' => Optional[String[1]], | ||
'AutoNegotiation' => Optional[Enum['yes','no']], | ||
'WakeOnLan' => Optional[Enum[ | ||
'phy', 'unicast', 'multicast', 'broadcast', | ||
'arp', 'magic', 'secureon' | ||
]], | ||
'WakeOnLanPassword' => Optional[String[1]], | ||
'Port' => Optional[Enum['tp', 'aui', 'bnc', 'mii', 'fibre']], | ||
'Advertise' => Optional[Variant[ | ||
Systemd::Interface::Link::Link_advertise, | ||
Array[Systemd::Interface::Link::Link_advertise] | ||
]], | ||
'ReceiveChecksumOffload' => Optional[Enum['yes','no']], | ||
'TransmitChecksumOffload' => Optional[Enum['yes','no']], | ||
'TCPSegmentationOffload' => Optional[Enum['yes','no']], | ||
'TCP6SegmentationOffload' => Optional[Enum['yes','no']], | ||
'GenericSegmentationOffload' => Optional[Enum['yes','no']], | ||
'GenericReceiveOffload' => Optional[Enum['yes','no']], | ||
'LargeReceiveOffload' => Optional[Enum['yes','no']], | ||
'ReceivePacketSteeringCPUMask' => Optional[String[1]], | ||
'ReceiveVLANCTAGHardwareAcceleration' => Optional[Enum['yes','no']], | ||
'TransmitVLANCTAGHardwareAcceleration'=> Optional[Enum['yes','no']], | ||
'ReceiveVLANCTAGFilter' => Optional[Enum['yes','no']], | ||
'TransmitVLANSTAGHardwareAcceleration'=> Optional[Enum['yes','no']], | ||
'NTupleFilter' => Optional[Enum['yes','no']], | ||
'RxChannels' => Optional[Variant[Enum['max'],Integer[1,4294967295]]], | ||
'TxChannels' => Optional[Variant[Enum['max'],Integer[1,4294967295]]], | ||
'OtherChannels' => Optional[Variant[Enum['max'],Integer[1,4294967295]]], | ||
'CombinedChannels' => Optional[Variant[Enum['max'],Integer[1,4294967295]]], | ||
'RxBufferSize' => Optional[Variant[Enum['max'],Integer[1,4294967295]]], | ||
'RxMiniBufferSize' => Optional[Variant[Enum['max'],Integer[1,4294967295]]], | ||
'RxJumboBufferSize' => Optional[Variant[Enum['max'],Integer[1,4294967295]]], | ||
'TxBufferSize' => Optional[Variant[Enum['max'],Integer[1,4294967295]]], | ||
'RxFlowControl' => Optional[Enum['yes','no']], | ||
'TxFlowControl' => Optional[Enum['yes','no']], | ||
'AutoNegotiationFlowControl' => Optional[Enum['yes','no']], | ||
'GenericSegmentOffloadMaxBytes' => Optional[String[1]], | ||
'GenericSegmentOffloadMaxSegments' => Optional[Integer[1, 65535]], | ||
'UseAdaptiveRxCoalesce' => Optional[Enum['yes','no']], | ||
'UseAdaptiveTxCoalesce' => Optional[Enum['yes','no']], | ||
'RxCoalesceSec' => Optional[Integer], | ||
'RxCoalesceIrqSec' => Optional[Integer], | ||
'RxCoalesceLowSec' => Optional[Integer], | ||
'RxCoalesceHighSec' => Optional[Integer], | ||
'TxCoalesceSec' => Optional[Integer], | ||
'TxCoalesceIrqSec' => Optional[Integer], | ||
'TxCoalesceLowSec' => Optional[Integer], | ||
'TxCoalesceHighSec' => Optional[Integer], | ||
'RxMaxCoalescedFrames' => Optional[Integer], | ||
'RxMaxCoalescedIrqFrames' => Optional[Integer], | ||
'RxMaxCoalescedLowFrames' => Optional[Integer], | ||
'RxMaxCoalescedHighFrames' => Optional[Integer], | ||
'TxMaxCoalescedFrames' => Optional[Integer], | ||
'TxMaxCoalescedIrqFrames' => Optional[Integer], | ||
'TxMaxCoalescedLowFrames' => Optional[Integer], | ||
'TxMaxCoalescedHighFrames' => Optional[Integer], | ||
'CoalescePacketRateLow' => Optional[Integer], | ||
'CoalescePacketRateHigh' => Optional[Integer], | ||
'CoalescePacketRateSampleIntervalSec' => Optional[Integer], | ||
'StatisticsBlockCoalesceSec' => Optional[Integer[1]], | ||
'MDI' => Optional[Enum['straight', 'mdi', 'crossover', 'mdi-x', 'mdix', 'auto']], | ||
'SR_IOVVirtualFunctions' => Optional[Integer[0, 2147483647]], | ||
}] |
Oops, something went wrong.