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,
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAChvjRD%3DTtCdgBGqp2en0OJsBWyfJ0xQhrf6UcrPXTUumMbDew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
source => 'puppet:///modules/foo/script.lua'ensure => 'present',file { 'script.lua' :Is there a way for the manifest to do: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.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.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.
...
}
ensure => 'present',file { 'file2' :->INSERT MAGIC REREAD FACTS BLOCK
->...template => template('foo/file2.erb')
}
?