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.
Best Answer
put $hostname to file name or directory name: