-
-
Notifications
You must be signed in to change notification settings - Fork 152
add possibility to manage network interfaces with a template #497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
trefzer
wants to merge
7
commits into
voxpupuli:master
Choose a base branch
from
cirrax:dev_network
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ea9ef3b
add possibility to manage network interfaces with a template
trefzer 8db8d8b
Update manifests/networkd.pp
trefzer 1db45b9
Update manifests/networkd.pp
trefzer fed28e2
Update manifests/networkd.pp
trefzer 987a3c8
Update manifests/networkd.pp
trefzer 862d3c2
systemd::networkd: reverse the alignment of the class parameters
trefzer 64cb44d
follow puppet-strings annotation for types
trefzer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 = {}, | ||
traylenator marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 hidden or 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 hidden or 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 @@ | ||
# @summary Network device configuration(Link) | ||
# @see https://www.freedesktop.org/software/systemd/man/latest/systemd.link.html | ||
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 hidden or 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,85 @@ | ||
# @summary Network device configuration(Link) Link section definition | ||
# @see https://www.freedesktop.org/software/systemd/man/latest/systemd.link.html | ||
type Systemd::Interface::Link::Link = Struct[{ | ||
'Description' => Optional[String[1]], | ||
traylenator marked this conversation as resolved.
Show resolved
Hide resolved
|
||
'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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.