From ca387c1142102805a10491fcefbe032e41bbacc5 Mon Sep 17 00:00:00 2001 From: Ryan Rotter Date: Tue, 24 Dec 2024 15:52:21 -0500 Subject: [PATCH] base profile maintenance - add zstd - rm dselect (unused, was a preference of a former colleague) - rm ifenslave (only used on EoL machines) - rm vlan on vms, since tagging is handled on vmhost - rm mcollective management: this service is no longer installed - assume we're on debian or ubuntu, no other os is supported --- manifests/profile/base.pp | 42 +++++++++++----------- manifests/profile/base/stop_mcollective.pp | 16 --------- spec/classes/profile/base_spec.rb | 27 ++++++++------ 3 files changed, 38 insertions(+), 47 deletions(-) delete mode 100644 manifests/profile/base/stop_mcollective.pp diff --git a/manifests/profile/base.pp b/manifests/profile/base.pp index b811f9981..38f1d4627 100644 --- a/manifests/profile/base.pp +++ b/manifests/profile/base.pp @@ -24,30 +24,32 @@ 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': @@ -55,8 +57,6 @@ 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 } diff --git a/manifests/profile/base/stop_mcollective.pp b/manifests/profile/base/stop_mcollective.pp deleted file mode 100644 index 58826ff5d..000000000 --- a/manifests/profile/base/stop_mcollective.pp +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2018 The Regents of the University of Michigan. -# All Rights Reserved. Licensed according to the terms of the Revised -# BSD License. See LICENSE.txt for details. - -# nebula::profile::base::stop_mcollective -# -# Disable mcollective on all machines. -# -# @example -# include nebula::profile::base::stop_mcollective -class nebula::profile::base::stop_mcollective { - service { 'mcollective': - ensure => 'stopped', - enable => false, - } -} diff --git a/spec/classes/profile/base_spec.rb b/spec/classes/profile/base_spec.rb index 85086f724..b98d6d694 100644 --- a/spec/classes/profile/base_spec.rb +++ b/spec/classes/profile/base_spec.rb @@ -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") } @@ -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"}) @@ -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"})