Skip to content

Commit

Permalink
Merge pull request #783 from mlibrary/zstd
Browse files Browse the repository at this point in the history
base profile maintenance
  • Loading branch information
rrotter authored Jan 2, 2025
2 parents e882a46 + ca387c1 commit 3f92590
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 47 deletions.
42 changes: 21 additions & 21 deletions manifests/profile/base.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,39 @@
enable => true,
}

if $facts['os']['family'] == 'Debian' {
package { 'dselect': }
package { 'ifenslave': }
unless $facts['is_virtual'] {
package { 'vlan': }
package { 'dbus': }
package { 'dkms': }
}

ensure_packages([
'dbus', # ??
'dkms', # afs?
'zstd', # prevent warnings about fallback on `apt dist-upgrade`
])

file { '/etc/localtime':
ensure => 'link',
target => "/usr/share/zoneinfo/${timezone}",
}
file { '/etc/localtime':
ensure => 'link',
target => "/usr/share/zoneinfo/${timezone}",
}

file { '/etc/timezone':
content => "${timezone}\n",
}
file { '/etc/timezone':
content => "${timezone}\n",
}

file { '/etc/hostname':
content => "${::networking['fqdn']}\n",
notify => Exec["/bin/hostname ${::networking['fqdn']}"],
}
file { '/etc/hostname':
content => "${::networking['fqdn']}\n",
notify => Exec["/bin/hostname ${::networking['fqdn']}"],
}

exec { "/bin/hostname ${::networking['fqdn']}":
refreshonly => true,
}
exec { "/bin/hostname ${::networking['fqdn']}":
refreshonly => true,
}

class { 'nebula::profile::base::motd':
contact_email => $contact_email,
sysadmin_dept => $sysadmin_dept,
}

include nebula::profile::base::stop_mcollective

if $facts['dmi'] and ($facts['dmi']['manufacturer'] == 'HP' or $facts['dmi']['manufacturer'] == 'HPE') {
include nebula::profile::base::hp
}
Expand Down
16 changes: 0 additions & 16 deletions manifests/profile/base/stop_mcollective.pp

This file was deleted.

27 changes: 17 additions & 10 deletions spec/classes/profile/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ def contain_base_class(name)

case os
when %r{^debian}, %r{^ubuntu}
it { is_expected.to contain_package("dselect") }
it { is_expected.to contain_package("ifenslave") }
it { is_expected.to contain_package("vlan") }
it { is_expected.to contain_package("zstd") }
it { is_expected.to contain_package("dbus") }
it { is_expected.to contain_package("dkms") }

Expand Down Expand Up @@ -99,13 +97,6 @@ def contain_base_class(name)
end
end

it do
expect(subject).to contain_service("mcollective").with(
ensure: "stopped",
enable: false
)
end

context "when on an HP machine" do
let(:facts) do
super().merge("dmi" => {"manufacturer" => "HP"})
Expand All @@ -124,6 +115,22 @@ def contain_base_class(name)
end
end

context "when on a vm" do
let(:facts) do
super().merge("is_virtual" => true)
end

it { is_expected.not_to contain_package("vlan") }
end

context "when not on a vm" do
let(:facts) do
super().merge("is_virtual" => false)
end

it { is_expected.to contain_package("vlan") }
end

context "when on an HPE machine" do
let(:facts) do
super().merge("dmi" => {"manufacturer" => "HPE"})
Expand Down

0 comments on commit 3f92590

Please sign in to comment.