| In the puppet apply case, we try to retrieve file content using metadata.path, but in the recusive file case path is the initial point of recursion, it's more like base_path. We need to call metadata.full_path instead, which joins the path and relative_path.
[{"path"=> |
"/etc/puppetlabs/code/environments/production/modules/filetest/files/dir", |
"relative_path"=>".", |
"links"=>"manage", |
"owner"=>996, |
"group"=>994, |
"mode"=>420, |
"checksum"=>{"type"=>"ctime", "value"=>"{ctime}2020-03-12 17:06:06 UTC"}, |
"type"=>"directory", |
"destination"=>nil}, |
{"path"=> |
"/etc/puppetlabs/code/environments/production/modules/filetest/files/dir", |
"relative_path"=>"dir", |
"links"=>"manage", |
"owner"=>996, |
"group"=>994, |
"mode"=>420, |
"checksum"=>{"type"=>"ctime", "value"=>"{ctime}2020-03-12 17:06:06 UTC"}, |
"type"=>"directory", |
"destination"=>nil}, |
{"path"=> |
"/etc/puppetlabs/code/environments/production/modules/filetest/files/dir", |
"relative_path"=>"dir/file", |
"links"=>"manage", |
"owner"=>996, |
"group"=>994, |
"mode"=>420, |
"checksum"=> |
{"type"=>"md5", "value"=>"{md5}d41d8cd98f00b204e9800998ecf8427e"}, |
"type"=>"file", |
"destination"=>nil}]
|
|