Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Say you had a file directive like so:

***SNIP***
file: "/tmp/file_I_need":
    path => "/tmp/file_I_need",
    ensure => "present",
    source:[
        "puppet://$fileserver/files/$name/file_I_need",
        "puppet://$fileserver/files/$group/file_I_need",
        "puppet://$fileserver/files/default/file_I_need",
        ];
***SNIP***

And then each file like so:

files/name_that_exists>/file_I_need
files/group_that_exists>/file_I_need
files/default/file_I_need

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)

NOTE:

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.

share|improve this question
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
add comment

1 Answer

put $hostname to file name or directory name:

source => ["puppet://${fileserver}/files/${name}/file_for_${hostname}.txt",
"puppet://${fileserver}/files/${name}/file_for_default_host.txt"]
share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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