Skip to content

Conversation

@traylenator
Copy link

With puppetlabs-stdlib version 9:

juin 10 20:18:41 isaac puppet[23883]: Warning: This function is deprecated, please use stdlib::ensure_packages instead. at ["/etc/puppetlabs/code/environments/production/modules/mit_krb5/manifests/install.pp", 32]:["/etc/puppetlabs/code/environments/production/site.pp", 15]

With puppetlabs-stdlib version 9:

```
juin 10 20:18:41 isaac puppet[23883]: Warning: This function is deprecated, please use stdlib::ensure_packages instead. at ["/etc/puppetlabs/code/environments/production/modules/mit_krb5/manifests/install.pp", 32]:["/etc/puppetlabs/code/environments/production/site.pp", 15]
```
@traylenator traylenator changed the title Avoid deprecation of ensure_package Avoid deprecated ensure_package Jun 10, 2023
@riton riton self-assigned this Jul 28, 2023
@riton
Copy link
Member

riton commented Jul 28, 2023

Hi @traylenator
Thanks for the contribution 👍

While I absolutely think we should tend toward the use of stdlib::ensure_packages, this will make this module incompatible with version 8.x of the puppetlabs-stdlib.
Version 9.x of puppetlabs-stdlib is still pretty new (May 30th 2023). We're not quite ready to drop support for those who are not yet ready to migrate to the latest puppetlabs-stdlib version. This include us at IN2P3-CC 😇

What about using something like:

$packages = $install.map |String $package_name| {
  {
    $package_name => {
      ensure => 'installed',
    }
  }
}

ensure_resources('package', $packages)

This would buy current module users some time to migrate their code to the latest puppetlabs-stdlib version while still allowing use with stdlib v9.x.

Thoughts ?

Regards

@jhoblitt
Copy link

@riton stdlib 8.x/9.x compatibility should be resolved by puppetlabs/puppetlabs-stdlib#1377

@jhoblitt
Copy link

This PR would supersede #34

@traylenator
Copy link
Author

ensure_resources('package', $packages)

You can do just as

ensure_resources('packages', { 'ensure' => 'installed'})

rather than setting that up upfront.

For me nothing special needed, I am running a patched version this forever and can continue to do so. Only use this at home.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants