On Jul 29, 7:55 am, Oliver Beattie <oli...@obeattie.com> wrote:
> Hi,
>
> I need to use the output of a script to set the value of a variable. I
> understand the only way to do this is to use a custom Facter fact.
>
> However, this script will only run when (naturally) it's been installed,
> which is something Puppet takes care of. Conf files, which I would very much
> like to be able to install as part of the same run depend on the variable
> being set.
>
> So, it seems I have myself a lovely little chicken and egg problem — any
> ideas?


If you only need the script for this purpose then instead of writing a
custom fact that reports the output of your script, convert your
script into the custom fact.  You have the full power of Ruby at your
disposal.  If that's sufficient then it's cleaner in multiple ways.

It sounds like that may not be enough for you, however.  If there are
reasons other than script installation why you want the fact value to
be computed somewhere in the middle of the run, then you have two
options that I can see:

1) Accept that (at least) two Puppet runs will sometimes be required
to move a client into its intended state.

2) Move the needed code from your existing script to one of the
affected Package's install scripts.  Naturally, this requires rolling
a custom version of that package.


John


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to