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': }

On Monday, September 11, 2023 at 4:57:20 PM UTC-4 Tim.Mooney wrote:

>
> 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 [email protected]
> Enterprise Computing & Infrastructure /
> Division of Information Technology / 701-231-1076 <(701)%20231-1076> 
> (Voice)
> North Dakota State University, Fargo, ND 58105-5164
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/41e7a61b-78d6-41e4-854c-82e21d18cb36n%40googlegroups.com.

Reply via email to