Say you had a file directive like so:

file: "/tmp/file_I_need":
    path => "/tmp/file_I_need",
    ensure => "present",

And then each file like so:


The question is this:

How do I tell which source file puppet is using? If I am running puppet on different hosts, I expect different files, I know it will use the file that matched first.

Short of modifying the file and seeing if the changes made it,is there a way to see exactly which of the 3 source files it chose?

This is puppet 2.6.2.(Server running on Debian)


I am seeking a different method than using a hash of the file. I also do not like the solution of putting the filename(or similar) somewhere in each file. I want to know how to get the path from puppet.

  • 1
    The md5 sum of the file used is reported, it is a bit tedious, but you use that to determine which file was used. – Zoredache Dec 26 '12 at 19:19

put $hostname to file name or directory name:

source => ["puppet://${fileserver}/files/${name}/file_for_${hostname}.txt",
| improve this answer | |
  • I am looking for a place where puppet would tell me, I(puppet) used this file : files/node1/file_I_need – Nick P. Dec 26 '12 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.