> On 27 Oct 2016, at 02:35, Jakov Sosic <[email protected]> wrote:
> 
> On 10/22/2016 04:32 PM, Martin Alfke wrote:
> 
>> 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.
> 
> I divided my manifests into two parts:
> 
> First part sets up yum and repositories (before main), and
> 
> second part sets up everything else.
> 
> 
> This frees me from depending my modules on some specific yum repository, and 
> enables me to manage repositories separately from everything else.

Are you aware of the collector and chaining?

Yumrepo <| tag == ‘myrepos_first’ |> -> Package <| tag == 
‘mypackages_afterwards’ |>

This ensures that all yumrepos (with tag) are declared prior the package (with 
tag) gets managed.

> 
> 
>>> 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.
> 
> What I tried to achieve with this is to run class in a stage, without trying 
> to define it in a resource-type definition…

AFAIK this is not possible.
stage is a metaparameter so you can not use it as a parameter in a class.
Attaching classes to a stage must be done via class declaration as resource 
type.

hth,
Martin


> 
> 
>> Not think about the following declaration
>> 
>> class { ‘my::conf’:
>>  stage => ‘foo’,
>> }
>> 
>> What should puppet now use?
> 
> It should use 'foo' because params in class definition only define "default" 
> value...
> 
> -- 
> 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/30be6196-e183-63a4-8f00-d8404a7289ea%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/F3F3D4CC-8C5D-4FE9-9FEB-46F3D96F1855%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to