I'm trying to use puppet to copy a file:
file{ '/root/.ssh/id_rsa' :
source => 'puppet:///modules/certs/.ssh/id_rsa',
}
The permissions are -r-------- 1 root root
.
If I run chmod +r
on the file my script works, but with the above permissions puppet fails to copy the file.
Error: /Stage[main]/Main/Node[default]/File[/root/.ssh/id_rsa]: Could not evaluate: Could not retrieve file metadata for puppet:///modules/certs/.ssh/id_rsa: Error 500 on SERVER: Server Error: Permission denied - /etc/puppetlabs/code/environments/production/modules/certs/files/.ssh/id_rsa
I assumed puppet would be running as root and thus would be able to copy the file. Is there a way to do this without changing the permission?