Thanks, Felix, for clarifying. As far as I know, facts are collected *before* the execution. therefore the following workflow will not work: 1. generate certificates 2. distribute them across the odes (including their contents).
Any workaround for this? One idea I could come up is to export the file only if it exists and is not empty. That leads to a double run. On the first run the certificates would be generated. Then, on the second run the facter would be able to pick up the file contents. Cheers, Gin On Friday, December 26, 2014 7:50:56 PM UTC, Felix.Frank wrote: > > Hi, > > I assume that you're hoping for the export to pick up file contents on the > exporting agent node and distribute it to all collecting nodes, yes? > > This cannot work. Exported resources are basically just key/value > containers. The collecting catalog will just receive a resource with a > `source` parameter that references a file that is local to the agent that > will apply this new catalog. > > To transfer data from an agent to others in this fashion, you will have to > 1. Create a custom fact that takes the desired file content as its value. > 2. Export a file resource that passes this value to the agents through the > `content` attribute > > Your collectors will work just as expected then. > > Please note that the whole file content needs to be kept in PuppetDB, and > is included verbatim in each involved catalog. For large files, this can be > rather expensive. > > HTH, > Felix > > On 12/25/2014 10:35 PM, Gin wrote: > > Hello Everyone, > > I want to share a file across several nodes using exported resources. > The example configuration that I use looks like this: > http://pastebin.com/ZMEbBAW4 > I've tried both, with source = file://XXX and source = XXX. > I have a /tmp/input file on the "source_node" and expect it to be > recreated as /tmp/output on the "target_node". > > The operation consists of 2 steps. > > - Firstly I run "sudo puppet agent -td" on the "source_node". > - The only file-related evidence is two uninformative lines in > puppetdb.log with a few md5 entries. > - Then I trigger the "target_node" and get such an output: > - "Error: /Stage[main]/Main/Node[source_node]/File[/tmp/output]: > Could not evaluate: Could not retrieve information from environment > production source(s) /tmp/input" > > This is a follow-up of > https://ask.puppetlabs.com/question/14891/transferring-files-from-node-to-node/ > I'm stuck with this for quite a while now hence thought to try my luck > here. > > Thanks, > Gin > > > -- 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/be92e6ea-3b40-4866-8651-a2ae247b2ca1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
