puppet idiom to select particular module stream?

184 views
Skip to first unread message

Tim Mooney

unread,
Sep 11, 2023, 4:57:20 PM9/11/23
to puppet...@googlegroups.com

All-

RHEL 8 and RHEL 9 and their rebuilds and related distros inherited DNF
modularity from Fedora, as a kind of replacement for Software Collections
Library alternate package version.

I've been unable to find the correct puppet idiom to do the following:

1) ensure a particular module stream is enabled *before* installing
packages from that stream.
2) install the package(s).

I thought that this would work:

package { 'enable-nodejs18':
ensure => 'nodejs:18',
name => 'nodejs',
provider => 'dnfmodule',
enable_only => true,
}

package { 'nodejs':
ensure => installed,
require => Package['enable-nodejs18'],
}

But that doesn't work. I still get the base OS version of 'nodejs'
installed. The correct module stream isn't enabled (first). If we
manually (outside puppet) switch the client to the correct stream,
then the 2nd package resource does install the version we want.
Obviously, we want to control the one-time module stream selection in
puppet too.

Can anyone tell me what the correct idiom is to do what I'm trying to
accomplish?

Thanks!

Tim
--
Tim Mooney Tim.M...@ndsu.edu
Enterprise Computing & Infrastructure /
Division of Information Technology / 701-231-1076 (Voice)
North Dakota State University, Fargo, ND 58105-5164

vche...@gmail.com

unread,
Sep 12, 2023, 9:47:07 AM9/12/23
to Puppet Users
It should work,  I use similar approach. Try to adjust your parameters, this what works for me

package { 'nodejs-module':
  ensure => '18',
  enable_only => true,
  provider => 'dnfmodule', 
}
-> package { 'nodejs': }
Reply all
Reply to author
Forward
0 new messages