Skip to content
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

base profile maintenance #783

Merged
merged 1 commit into from
Jan 2, 2025
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
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
Loading