Copy file from Agent to Master

91 views
Skip to first unread message

Dennis Sullivan

unread,
Nov 8, 2022, 10:36:19 AM11/8/22
to Puppet Users
Hi Puppet Users,

Can someone provide input. I am trying to write a file from the puppet agent (i.e. /etc/ssh/host.pub) to the puppet master that has a custom mount point on it.  I don't want to have share the NFS out mount out globally.  Is there a resources that will allow me to accomplish this?  I tried the file resource source => puppet:///<custommountpoint> but it keeps telling me the source needs to be fully qualified.

Thank you in advanced,

Martin Alfke

unread,
Nov 10, 2022, 3:22:37 AM11/10/22
to puppet...@googlegroups.com
Hi Dennis,

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


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/9000108d-f010-4467-8455-6445cae04f89n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages