On Wednesday, April 23, 2014 11:00:30 AM UTC-5, warden wrote:
>
> Hi,
>
> I am trying to copy files between nodes using exported resources.
> What I want to do is to copy contents of the file from node1 to node2 
> (exactly same location), basicly rsync functionality.
>
> Here is my scenario:
>
> node1 and node2 include a common class
>
> in common.pp i have:
>   @@file { "filename-${hostname}":
>     path => "/file/path/somefile",
>   }
>  
> As I understand this is collecting filename-node1 and filename-node2.
> Then, in node2 I have a line:
>
> File<<| title == 'filename-node2' |>>
>
> Unfortunately, I get always an empty file on node2. Did I misunderstand 
> the way Exported Resources work?
>
>

Yes, you did.  Exported resources would be more precisely described as 
"exported *declarations*".  They provide a way to declare a resource in the 
context of compiling one node's catalog that later can be incorporated by 
reference into other nodes' catalogs (or the same node's).  Exporting a 
resource has nothing directly to do with the physical resource on the 
target node; it is all about the declaration.

More generally, Puppet provides no special facility for moving data between 
nodes, and it provides only a narrow mechanism for moving data from nodes 
to the master (i.e. node facts).  If the master copy of your file resides 
on a shared filesystem then you could use a File resource to ensure that 
other copies were synced to the master copy.  Alternatively, if you put the 
master copy on your Puppet master then you can sync it to all nodes that 
need it.  The latter is the mechanism that best fits the Puppet paradigm.


John

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c80fc385-ca91-4397-bdd7-f01810d11d63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to