Skip to content
This repository was archived by the owner on Nov 11, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
$ipv6enable = undef,

# Stdmod commons
$package_name = undef,
$package_name = $::network::params::package_name,
$package_ensure = 'present',

$service_restart_exec = $::network::params::service_restart_exec,
Expand Down Expand Up @@ -197,6 +197,11 @@
ensure => $package_ensure,
name => $package_name,
}
Package['network'] -> Network::Interface<||>
Package['network'] -> Network::Route<||>
Package['network'] -> Network::Mroute<||>
Package['network'] -> Network::Rule<||>
Package['network'] -> Network::Routing_table<||>
}

if $config_file_path
Expand Down
5 changes: 5 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
default => undef,
}

$package_name = $::operatingsystem ? {
'Ubuntu' => 'ifupdown',
default => undef,
}

case $::osfamily {
'Debian','RedHat','Amazon','Suse', 'Solaris': { }
default: {
Expand Down
10 changes: 10 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

['Debian', 'RedHat'].each do |osfamily|

operatingsystem = 'Debian' if osfamily == 'Debian'
operatingsystem = 'RedHat' if osfamily == 'RedHat'

context "#{osfamily} configuration via custom template" do

let(:params) {{
Expand All @@ -14,6 +17,7 @@
}}
let(:facts) {{
:osfamily => osfamily,
:operatingsystem => operatingsystem,
}}

it {
Expand All @@ -32,6 +36,7 @@
}}
let(:facts) {{
:osfamily => osfamily,
:operatingsystem => operatingsystem,
}}

it {
Expand All @@ -47,6 +52,7 @@
}}
let(:facts) {{
:osfamily => osfamily,
:operatingsystem => operatingsystem,
}}

it {
Expand All @@ -63,6 +69,7 @@
}}
let(:facts) {{
:osfamily => osfamily,
:operatingsystem => operatingsystem,
}}

it {
Expand All @@ -87,6 +94,7 @@
}}
let(:facts) {{
:osfamily => osfamily,
:operatingsystem => operatingsystem,
}}

it {
Expand All @@ -105,6 +113,7 @@

let(:facts) {{
:osfamily => 'RedHat',
:operatingsystem => 'RedHat',
}}
let(:params) {{
:config_file_source => "puppet:///modules/network/spec.conf",
Expand All @@ -124,6 +133,7 @@

let(:facts) {{
:osfamily => 'Debian',
:operatingsystem => 'Debian',
}}
let(:params) {{
:config_file_source => "puppet:///modules/network/spec.conf",
Expand Down