It would be very interesting to read other people opinion.

>From my point of view I currently only see a couple of solutions, and I
don't like any of them.

The first one is what you have said, a custom fact and run the puppet twice.

The second one is uglier yet, use a exec to set the sha1sum inside the
template.

Regards,
El 28/03/2014 04:40, "Jason Price" <[email protected]> escribió:

> Problem: Puppet pushes two files, and two services.  One service (redis)
> reads one of the files (a lua script), and spits out a sha1sum.  However,
> it somehow transforms the file before it produces the sha1sum, so there's
> no way to know what the sum will be, before the reading.
>
> File two (read by service two) must know what the sha1sum if the first
> file is.
>
> Semi-obvious solution: make external fact to read in the file, and produce
> the sha1sum as a fact readable by puppet.  Use said fact in the template
> for file2, and you're done.
>
> However, the facts are generated before any files are changed via puppet.
> And I hate having to run puppet twice to converge on a correct setup.
>
> Is there a way for the manifest to do:
>
> file { 'script.lua' :
>   ensure => 'present',
>   ...
>   source => 'puppet:///modules/foo/script.lua'
> }
> ->
> INSERT MAGIC REREAD FACTS BLOCK
> ->
> file { 'file2' :
>   ensure => 'present',
>   ...
>   template => template('foo/file2.erb')
> }
>
> ?
>
> Thanks for any help.
> Jason
>
> --
> 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/CAChvjRD%3DTtCdgBGqp2en0OJsBWyfJ0xQhrf6UcrPXTUumMbDew%40mail.gmail.com<https://groups.google.com/d/msgid/puppet-users/CAChvjRD%3DTtCdgBGqp2en0OJsBWyfJ0xQhrf6UcrPXTUumMbDew%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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/CAF_B3ddv0Kn4ckeiaDMPGG9oAVBVcMqYJu7fk3yycHf8AxBUfw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to