Le 12/06/2015 à 07:06:49-0700, jcbollinger a écrit
>
> You don't.  If you were willing to write a custom function or possibly to

That' sucks ...

> engage in some ruby-fu inan inline template then you could extract a list of
> the titles of all Things::Addthing resources declared to that point during
> catalog building, but that's not necessarily the same thing, as instances may
> have been declared elsewhere, too.

Exactly.

> More generally, it is never a good idea for your manifests to rely on
> extracting data from the catalog under construction. The result of any such
> inquiry is necessarily dependent on the order in which Puppet evaluates your

In fact the order don't matters for me.

> manifests, which is difficult to predict.  Instead, focus on data first, and
> code second.  For example, if you want a list of the Thing::Addthings, then
> start with that, and use it to make your declarations, instead of making your
> declarations and after the fact trying to determine what you declared (which 
> in
> truth you already know anyway):
>
> class my_service {
>   include ::things
>
>   $thinglist = [ 'first', 'second', 'third' ]
>
>   things::addthing { $thinglist: }
> }
>
> It's shorter, too.

Well, I can do that, but that's become really hard to read if for each
thing they are lots of parameters.

In fact I event don't how to do that with lots of parameters. Let's say I
want do what you say, how can I factorise

  things:addthing { 'first':
    'param1' => 'value1',
    ....
    'param10' => 'value10',
    }

  things:addthing { 'second':
    'param1' => 'value1',
    ....
    'param10' => 'value10',
    }

  things:addthing { 'third':
    'param1' => 'value1',
    ....
    'param10' => 'value10',
    }
(actually it's not 10 but 9).

How can I use a array ?

Thanks for your answer.

Regards.

JAS


--
Albert SHIH
DIO bâtiment 15
Observatoire de Paris
5 Place Jules Janssen
92195 Meudon Cedex
France
Téléphone : +33 1 45 07 76 26/+33 6 86 69 95 71
xmpp: j...@obspm.fr
Heure local/Local time:
jeu 18 jui 2015 16:05:23 CEST

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20150618141445.GB36278%40pcjas.obspm.fr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to