Hi Jakov,
> On 15 Oct 2016, at 05:18, Jakov Sosic <
jso...@gmail.com> wrote:
>
> Is there a way to disable metaparam checks, so that it won't break CI for my module?
>
> I have something along these lines:
>
> my/manifests/init.pp:
> class my {
> stage {'mystage': before => Stage['main'] }
> }
This code is fine.
You just declare a stage resource type.
Except for: why do you want to make use of stages?
Stages have been introduced as a high level ordering concept which is no longer best practice.
You should use standard ordering instead (require, before, subscribe, notify or chaining pattern.
>
> my/manifests/conf.pp:
> class my::conf (
> $stage = 'mystage',
> ) {
> …
> }
As the syntax validation states:
“stage” is a metaparameter and a reserved word in Puppet.
Your code example shows a parameterized class with “stage” as a parameter.
Not think about the following declaration
class { ‘my::conf’:
stage => ‘foo’,
}
What should puppet now use?
The stage metaparameter which uses the declared stage resource type or the parameter from the class definition?
You should rename the parameter in the class definition to a non reserved word.
see:
https://docs.puppet.com/puppet/latest/reference/lang_reserved.html
Best,
Martin
>
>
> So, when I run:
>
> bundle exec rake validate
>
> I get this:
>
> ---> syntax:manifests
> stage is a metaparam; this value will inherit to all contained resources in the my::conf definition
> rake aborted!
>
> ...
>
>
> Is there a way to avoid aborting tests in case metaparams are used?
>
> --
> 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
puppet-users...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/232c216b-2573-8712-4c61-51d45751257a%40gmail.com.
> For more options, visit
https://groups.google.com/d/optout.