Your email is a little bit confusing.
On one hand you mention that you have a file on an agent, which you like to be copied to the puppet server.
On the other hand you mention the file resource being copied from the puppet server.
Solution 1: Make a file from the agent available to the puppet server:
You can use exported resources to accomplish this.
On the agent you use an exported resource.
This resource is not added to the agent catalog, but stored via PuppetDB:
@@file { ‘/etc/ssh/host.pub’:
ensure => file,
…
}
On the server you use the collector, who fetches the information from PuppetDB:
File <<| title == ‘/etc/ssh/host.pub’ |>>
Solution 2: Make a folder available on the puppet server to allow usage of source parameter with custom path
You need to create an additional mount point.
Hth,
Martin