puppet-zabbix icon indicating copy to clipboard operation
puppet-zabbix copied to clipboard

overwriting module params

Open pelacables opened this issue 2 years ago • 6 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.X
  • Ruby: 2.5
  • Distribution: RH8
  • Module version: 9.2.0

How to reproduce (e.g Puppet code you use)

#Zabbix
zabbix::zabbix_version: 6.0

among other params in hiera.

What are you seeing

not all classes are reading the value defined in hiera.

What behaviour did you expect instead

My value of zabbix_version in all the classes.

Any additional information you'd like to impart

According to https://www.puppet.com/docs/puppet/6/lang_classes.html#lang_class_define-hiera-data-class-param-defaults params.pp should be drop in favor of hiera.

If you are maintaining older modules, you might encounter cases where class parameter defaults are set with a parameter class, such as params.pp, and class inheritance. Update such modules to use Hiera data instead. Class inheritance can have unpredictable effects and makes troubleshooting difficult. For details about updating existing params classes to Hiera data, see data in modules.

pelacables avatar Mar 29 '23 10:03 pelacables

you need to override $zabbix::params::zabbix_version because all class use it to customize version

Valantin avatar Mar 18 '24 13:03 Valantin

That I tried already and does not work, neither.

pelacables avatar Mar 18 '24 13:03 pelacables

can you post a manifest example of how you use the module? and the distribution was RHEL8 o what derivate?

Valantin avatar Mar 18 '24 13:03 Valantin

Ok, I've checked and you need to override version in all class because my suggestion wasn't applicable

Valantin avatar Mar 26 '24 20:03 Valantin

Also

  "requirements": [
    {
      "name": "puppet",
      "version_requirement": ">= 7.0.0 < 9.0.0"
    }
  ],

TheMeier avatar Mar 27 '24 08:03 TheMeier

Ops... I missed your answer. Exactly, I had to overwrite it everywhere and could not use it in hiera. Once I'm back I can take a look at my notes, if you need further feddback.

El dc., 27 de març 2024, 8:03, Christoph Maser @.***> va escriure:

Also

"requirements": [ { "name": "puppet", "version_requirement": ">= 7.0.0 < 9.0.0" } ],

— Reply to this email directly, view it on GitHub https://github.com/voxpupuli/puppet-zabbix/issues/870#issuecomment-2022161815, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYX2LSUCCHKVKOGBTENN73Y2JVM7AVCNFSM6AAAAAAWLZFYNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRSGE3DCOBRGU . You are receiving this because you authored the thread.Message ID: @.***>

pelacables avatar Mar 27 '24 08:03 pelacables