Skip to content

Commit

Permalink
More updates
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Oct 6, 2024
1 parent de25ed4 commit d9a5870
Show file tree
Hide file tree
Showing 33 changed files with 180 additions and 328 deletions.
20 changes: 10 additions & 10 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
fixtures:
repositories:
forge_modules:
yumrepo_core:
repo: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git
repo: puppetlabs/yumrepo_core
stdlib:
repo: https://github.com/puppetlabs/puppetlabs-stdlib.git
ref: v8.6.0
repo: puppetlabs/stdlib
augeasproviders_core:
repo: https://github.com/voxpupuli/puppet-augeasproviders_core.git
repo: puppet/augeasproviders_core
augeasproviders_shellvar:
repo: https://github.com/voxpupuli/puppet-augeasproviders_shellvar.git
repo: puppet/augeasproviders_shellvar
systemd:
repo: https://github.com/voxpupuli/puppet-systemd.git
repo: puppet/systemd
rsyslog:
repo: https://github.com/saz/puppet-rsyslog.git
repo: saz/rsyslog
network:
repo: https://github.com/voxpupuli/puppet-network.git
ref: v2.1.0
repo: puppet/network
filemapper:
repo: puppet/filemapper
symlinks:
mofed: "#{source_dir}"
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
fail-fast: false
matrix:
include:
- ruby: 2.7.7
- ruby: 2.7.8
puppet: 7
fixtures: .fixtures.yml
allow_failure: false
- ruby: 3.2.2
- ruby: 3.2.3
puppet: 8
fixtures: .fixtures.yml
allow_failure: false
Expand Down
10 changes: 9 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@ Style/TernaryParentheses:
Style/TrailingCommaInArguments:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: comma
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInArrayLiteral:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInHashLiteral:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: consistent_comma
Style/SymbolArray:
Description: Using percent style obscures symbolic intent of array's contents.
EnforcedStyle: brackets
Expand Down
2 changes: 2 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ appveyor.yml:
delete: true
spec/acceptance/nodesets/debian-11.yml:
delete: true
spec/acceptance/nodesets/debian-12.yml:
delete: true
spec/acceptance/nodesets/ubuntu-2004.yml:
delete: true
spec/acceptance/nodesets/ubuntu-2204.yml:
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ group :system_tests do
gem "beaker-pe", require: false
gem "beaker-hostgenerator"
gem "beaker-rspec"
gem "beaker-docker"
gem "beaker-puppet"
gem "beaker-docker", git: 'https://github.com/treydock/beaker-docker.git', branch: 'amazon-2023'
gem "beaker-puppet", git: 'https://github.com/puppetlabs/beaker-puppet.git', ref: '6063d22b6c4449df795731f5853c3c75241240c4'
gem "beaker-puppet_install_helper", require: false
gem "beaker-module_install_helper", require: false
end
Expand Down
83 changes: 37 additions & 46 deletions manifests/interface.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
Optional[Stdlib::IP::Address] $netmask = undef ,
Optional[Stdlib::IP::Address] $gateway = undef,
Boolean $enable = true,
Optional[Variant[Boolean, Enum['yes','no']]] $nm_controlled = undef,
Optional[Enum['yes','no']] $nm_controlled = undef,
Enum['yes', 'no'] $connected_mode = 'yes',
Optional[Integer] $mtu = undef,
Boolean $bonding = false,
Expand All @@ -55,20 +55,10 @@

include mofed

$onboot = $enable ? {
true => 'yes',
false => 'no',
default => $enable,
}

$options_extra_redhat = {
'CONNECTED_MODE' => $connected_mode,
}

if $facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'], '8') >= 0 {
$_nm_controlled = pick($nm_controlled, false)
} else {
if $facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'], '7') == 0 {
$_nm_controlled = pick($nm_controlled, 'no')
} else {
$_nm_controlled = $nm_controlled
}

if $bonding {
Expand All @@ -79,53 +69,54 @@
# Setup interfaces for the slaves
$bonding_slaves.each |String $ifname| {
network_config { $ifname:
ensure => $ensure,
onboot => $onboot,
master => $name,
slave => 'yes',
mtu => $mtu,
method => 'static',
hotplug => 'false',
options => {
ensure => $ensure,
onboot => $enable,
mtu => $mtu,
method => 'static',
hotplug => false,
options => {
'TYPE' => 'Infiniband',
'NM_CONTROLLED' => $_nm_controlled,
'MASTER' => $name,
'SLAVE' => 'yes',
'CONNECTED_MODE' => $connected_mode,
}
'NM_CONTROLLED' => $_nm_controlled,
}.filter |$k, $v| { $v =~ NotUndef },
}
}

# Setup the bonding interface
network_config { $name:
ensure => $ensure,
onboot => $onboot,
ipaddress => $ipaddr,
netmask => $netmask,
bonding_master => 'yes',
bonding_opts => $bonding_opts,
mtu => $mtu,
method => 'static',
hotplug => 'false',
options => {
ensure => $ensure,
onboot => $enable,
ipaddress => $ipaddr,
netmask => $netmask,
mtu => $mtu,
method => 'static',
hotplug => false,
options => {
'TYPE' => 'Infiniband',
'NM_CONTROLLED' => $_nm_controlled,
'BONDING_MASTER' => 'yes',
'BONDING_OPTS' => $bonding_opts,
'GATEWAY' => $gateway,
'CONNECTED_MODE' => $connected_mode,
}
'NM_CONTROLLED' => $_nm_controlled,
}.filter |$k, $v| { $v =~ NotUndef },
}
} else {
network_config { $name:
ensure => $ensure,
onboot => $onboot,
ipaddress => $ipaddr,
netmask => $netmask,
mtu => $mtu,
method => 'static',
hotplug => 'false',
options => {
ensure => $ensure,
onboot => $enable,
ipaddress => $ipaddr,
netmask => $netmask,
mtu => $mtu,
method => 'static',
hotplug => false,
options => {
'TYPE' => 'Infiniband',
'NM_CONTROLLED' => $_nm_controlled,
'GATEWAY' => $gateway,
'CONNECTED_MODE' => $connected_mode,
}
'NM_CONTROLLED' => $_nm_controlled,
}.filter |$k, $v| { $v =~ NotUndef },
}
}
}
5 changes: 4 additions & 1 deletion manifests/opensm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,21 @@
'present': {
$package_ensure = 'present'
$file_ensure = 'file'
$unit_ensure = 'present'
$service_ensure = 'running'
$service_enable = true
}
'absent': {
$package_ensure = 'absent'
$file_ensure = 'absent'
$unit_ensure = 'absent'
$service_ensure = 'stopped'
$service_enable = false
}
'disabled': {
$package_ensure = 'present'
$file_ensure = 'file'
$unit_ensure = 'present'
$service_ensure = 'stopped'
$service_enable = false
}
Expand Down Expand Up @@ -82,7 +85,7 @@
}

systemd::unit_file { '[email protected]':
ensure => $file_ensure,
ensure => $unit_ensure,
source => 'puppet:///modules/mofed/opensm/[email protected]',
}

Expand Down
8 changes: 1 addition & 7 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@
class mofed::service {
assert_private()

if $mofed::openibd_service_enable in ['UNSET', 'undef'] {
$_enable = undef
} else {
$_enable = $mofed::openibd_service_enable
}

if $mofed::manage_service {
service { 'openibd':
ensure => $mofed::openibd_service_ensure,
enable => $_enable,
enable => $mofed::openibd_service_enable,
name => $mofed::openibd_service_name,
hasstatus => $mofed::openibd_service_hasstatus,
hasrestart => $mofed::openibd_service_hasrestart,
Expand Down
5 changes: 4 additions & 1 deletion manifests/srp.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,23 @@
$package_ensure = 'present'
$file_ensure = 'file'
$srp_load = 'yes'
$unit_ensure = 'present'
$service_ensure = 'running'
$service_enable = true
}
'absent': {
$package_ensure = 'absent'
$file_ensure = 'absent'
$srp_load = 'no'
$unit_ensure = 'absent'
$service_ensure = 'stopped'
$service_enable = false
}
'disabled': {
$package_ensure = 'present'
$file_ensure = 'file'
$srp_load = 'yes'
$unit_ensure = 'present'
$service_ensure = 'stopped'
$service_enable = false
}
Expand Down Expand Up @@ -138,7 +141,7 @@
}

systemd::unit_file { '[email protected]':
ensure => $file_ensure,
ensure => $unit_ensure,
source => 'puppet:///modules/mofed/srp/[email protected]',
}

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@
],
"pdk-version": "2.7.1",
"template-url": "https://github.com/treydock/pdk-templates.git#master",
"template-ref": "heads/master-0-g52b1622"
"template-ref": "heads/master-0-gc7a6913"
}
4 changes: 2 additions & 2 deletions spec/acceptance/nodesets/el8.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
HOSTS:
rocky-8:
el8:
roles:
- agent
platform: el-8-x86_64
hypervisor: docker
image: almalinux:8
image: rockylinux:8
docker_preserve_image: true
docker_cmd:
- '/usr/sbin/init'
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/nodesets/el9.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
HOSTS:
almalinux-9:
el9:
roles:
- agent
platform: el-9-x86_64
hypervisor: docker
image: almalinux:9
image: rockylinux:9
docker_preserve_image: true
docker_cmd:
- '/usr/sbin/init'
Expand Down
Loading

0 comments on commit d9a5870

Please sign in to comment.