Skip to content

Commit

Permalink
add ipmi puppet module
Browse files Browse the repository at this point in the history
- install module on all bare metal (hp/dell) hosts
  • Loading branch information
rrotter committed Oct 14, 2024
1 parent 7d06550 commit a2df0a9
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 20 deletions.
1 change: 1 addition & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ fixtures:
repo: "https://github.com/mlibrary/puppetlabs-apache"
forge_modules:
rbenv: {"repo": "jdowning/rbenv", "ref": "3.0.0" }
ipmi: {"repo": "jhoblitt/ipmi", "ref": "6.1.0" }
archive: {"repo": "puppet/archive", "ref": "7.1.0" }
kmod: {"repo": "puppet/kmod", "ref": "4.0.1" }
# TODO: Puppet 8 requires version 11. 11 requires lens changes. https://forge.puppet.com/modules/puppet/letsencrypt/changelog
Expand Down
4 changes: 4 additions & 0 deletions manifests/profile/base.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@

if $facts['dmi'] and ($facts['dmi']['manufacturer'] == 'HP' or $facts['dmi']['manufacturer'] == 'HPE') {
include nebula::profile::base::hp
include nebula::profile::base::ipmi
}
if $facts['dmi'] and ($facts['dmi']['manufacturer'] == 'Dell Inc.') {
include nebula::profile::base::ipmi
}

include nebula::profile::base::i40e
Expand Down
12 changes: 12 additions & 0 deletions manifests/profile/base/ipmi.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# nebula::profile::base::ipmi
#
# add IPMI facts to puppetdb
# TODO: export resource for drac/ilo ip, hostname
# TODO: add ipmi configuration (manage users, etc)
#
# @example
# include nebula::profile::base::impi
class nebula::profile::base::ipmi
{
include ipmi
}
1 change: 1 addition & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"issues_url": "https://github.com/mlibrary/nebula/issues",
"dependencies": [
{"name": "jdowning/rbenv", "version_requirement": ">= 3.0.0 < 4.0.0" },
{"name": "jhoblitt/ipmi", "version_requirement": ">= 6.1.0 < 7.0.0" },
{"name": "puppet/archive", "version_requirement": ">= 7.1.0 < 8.0.0" },
{"name": "puppet/kmod", "version_requirement": ">= 4.0.1 < 5.0.0" },
{"name": "puppet/letsencrypt", "version_requirement": ">= 10.1.0 < 11.0.0"},
Expand Down
31 changes: 11 additions & 20 deletions spec/classes/profile/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,9 @@ def contain_base_class(name)
end

it do
is_expected.to contain_kmod__blacklist('hpwdt').with(
file: '/etc/modprobe.d/hpwdt-blacklist.conf',
)
end

it do
is_expected.to contain_kmod__blacklist('acpi_power_meter').with(
file: '/etc/modprobe.d/acpi_power_meter-blacklist.conf',
)
is_expected.to contain_kmod__blacklist('hpwdt').with(file: '/etc/modprobe.d/hpwdt-blacklist.conf')
is_expected.to contain_kmod__blacklist('acpi_power_meter').with(file: '/etc/modprobe.d/acpi_power_meter-blacklist.conf')
is_expected.to contain_class('ipmi')
end
end

Expand All @@ -130,15 +124,9 @@ def contain_base_class(name)
end

it do
is_expected.to contain_kmod__blacklist('hpwdt').with(
file: '/etc/modprobe.d/hpwdt-blacklist.conf',
)
end

it do
is_expected.to contain_kmod__blacklist('acpi_power_meter').with(
file: '/etc/modprobe.d/acpi_power_meter-blacklist.conf',
)
is_expected.to contain_kmod__blacklist('hpwdt').with(file: '/etc/modprobe.d/hpwdt-blacklist.conf')
is_expected.to contain_kmod__blacklist('acpi_power_meter').with(file: '/etc/modprobe.d/acpi_power_meter-blacklist.conf')
is_expected.to contain_class('ipmi')
end

it { is_expected.to contain_package('ssacli') }
Expand All @@ -149,8 +137,11 @@ def contain_base_class(name)
super().merge('dmi' => { 'manufacturer' => 'Dell Inc.' })
end

it { is_expected.not_to contain_kmod__blacklist('hpwdt') }
it { is_expected.not_to contain_kmod__blacklist('acpi_power_meter') }
it do
is_expected.not_to contain_kmod__blacklist('hpwdt')
is_expected.not_to contain_kmod__blacklist('acpi_power_meter')
is_expected.to contain_class('ipmi')
end
end

it { is_expected.not_to contain_package('i40e-dkms') }
Expand Down

0 comments on commit a2df0a9

Please sign in to comment.