Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation warning for parameters #564

Closed
gavinrogers opened this issue Feb 6, 2015 · 4 comments
Closed

Deprecation warning for parameters #564

gavinrogers opened this issue Feb 6, 2015 · 4 comments
Labels
needs-feedback Further information is requested

Comments

@gavinrogers
Copy link

Hi, thanks for the great module.

This warning:

==> puppetmasterlocal: Notice: [nginx] *** DEPRECATION WARNING***: HI! I notice that you're declaring some attributes in Class[nginx]. It 
is highly recommended to set these values via Hiera going forward. This will become mandatory in the near future. Please check out https:/
/github.com/jfryman/puppet-nginx/blob/master/docs/hiera.md for more information.
==> puppetmasterlocal: Notice: /Stage[main]/Nginx::Notice::Config/Notify[[nginx] *** DEPRECATION WARNING***: HI! I notice that you're decl
aring some attributes in Class[nginx]. It is highly recommended to set these values via Hiera going forward. This will become mandatory in
 the near future. Please check out https://github.com/jfryman/puppet-nginx/blob/master/docs/hiera.md for more information.]/message: defin
ed 'message' as '[nginx] *** DEPRECATION WARNING***: HI! I notice that you're declaring some attributes in Class[nginx]. It is highly reco
mmended to set these values via Hiera going forward. This will become mandatory in the near future. Please check out https://github.com/jf
ryman/puppet-nginx/blob/master/docs/hiera.md for more information.'
  • In this case, another module is parameterizing Class::nginx (specifically, this feature branch

So I don't see any sense in the error message, or in ever dropping support for doing this? Unless there is some way that modules can dynamically set hiera values (that's would be cool, but going down the rabbit hole a bit).

@3flex
Copy link
Contributor

3flex commented Apr 13, 2015

I think the answer is to to declare nginx::config and set parameters there instead of declaring nginx class.

There's more discussion of jfryman's rationale here: #536 (comment)

@3flex 3flex added the needs-feedback Further information is requested label Aug 12, 2015
@3flex
Copy link
Contributor

3flex commented Aug 12, 2015

@gavinrogers did this help at all? Are you still having issues?

@pscadiz
Copy link

pscadiz commented Jan 29, 2016

+1 on this issue, i am a user of the module (and branch) raised by @gavinrogers
The declaration of class nginx is placed in the module itself, so users will have the same warning once they use the module.

Is there a way for me, as a user, to override the module declaration to avoid the deprecation warning? Or is the only solution actually changing the declaration in the module?

@3flex 3flex changed the title Depreciation warning for parameters Deprecation warning for parameters Jan 29, 2016
@ElvenSpellmaker
Copy link

We've had to fork this module at work and remove the deprecation notice. While puppet doesn't support ::params any more, it does suggest that values may be overridden as parameters, something which this module doesn't support. (https://docs.puppet.com/puppet/latest/reference/lookup_quick_module.html#example-with-hiera)

# ntp/manifests/init.pp
# ntp/manifests/init.pp
class ntp (
  # default values are in ntp/data
  $autoupdate
  $service_name
) {
 ...
}

Note that $autoupdate and $service_name are parameters that are valid for overriding if you want to and that the page mentions nothing about stopping people from being able to override them.

This is annoying for us as we (obviously) have several different types of web server and not all are configured exactly the same, and we don't want to end up with one hiera file per role or machine just for this if we can help it.

The thing is, ::params inheritance is deprecated _not_ the ability to pass parameters to the class itself.

@jfryman jfryman closed this as completed Jul 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-feedback Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants