On Monday, September 9, 2013 2:35:39 AM UTC-5, Martin Alfke wrote:
>
> Hi Karl, 
>
> you can achieve this by one of the following procedures: 
>
> 1. by stage 
> - enable stages 
> http://docs.puppetlabs.com/puppet/latest/reference/lang_run_stages.html 
> - put build class into an early stage 
> - put all other classes into main stage 
>
> Pro: does need one puppet run only. 
>
>

Con: does not accomplish the OP's objective.  He wants to apply a module 
only on the first Puppet run (or at least that's how I read him).  Using 
stages could cause the module to be applied before all the others, but 
would not prevent it from being applied on every run.

 

> 2. by fact 
> - in initial class we manage a fact (/etc/facter/facts.d) and provide all 
> required resources which are needed initially. 
> - in standard modules we check for fact availability. 
>
> Note: the fact does not get delivered via pluginsync. 
> Con: needs two puppet runs as minimum. 
>
>

I think two runs is exactly what the OP is looking for: the first run is 
different from all subsequent ones.  A fact-based approach can accomplish 
this, either with a full-fledged, plugin-synced custom fact or with a 
facts.d-based one.  The basic idea is that declaration of the 
system-initialization class is conditioned on some fact value, and 
application of that class modifies the system so that the fact value 
reported on subsequent runs is different (so that the condition for 
declaring the system-initialization class is no longer satisfied).


John

-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to