Ask Your Question

Copying a file directoy to agents

asked 2015-12-10 10:24:42 -0600

bindo gravatar image

HI All, I'm very new to puppet and I'd like to know how I should go about copying a directory with files on to puppet agent nodes. My scenario:

I have a "/var/pupstuff" directory on my puppet server

i'd like to copy the the directory pupstuff and it's content (some files) on to my agent's "/home/bindo" location. Below is my code

 file { '/home/bindo/pupstuff':
    ensure  => directory,
    recurse => true,
    owner   => root,
    group   => root,
    mode    => 0644,
    source  => "puppet:///var/pupstuff",

But throws the below error,

   Error: /Stage[main]/Linux/File[/home/bindo/pupstuff]: Failed to generate additional resources using 'eval_generate': Error 400 on SERVER: Not authorized to call search on /file_metadata/var/pupstuff with {:recurse=>true, :checksum_type=>"md5", :links=>"manage"}
Error: /Stage[main]/Linux/File[/home/bindo/pupstuff]: Could not evaluate: Could not retrieve file metadata for puppet:///var/pupstuff: Error 400 on SERVER: Not authorized to call find on /file_metadata/var/pupstuff with {:source_permissions=>"use", :links=>"manage"}

Please can someone advice? Many thanks in advance


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-12-10 11:57:35 -0600

lupin gravatar image

Modify the value of your source paramater change it to source => "puppet:///modules/path_of_file". For example if you have a module named useful

the directory structure will like

  -> templates
  -> manifests
  -> files
     -> var
          -> pupstuff
edit flag offensive delete link more


Thank you very much for replying. I'm afraid I don't understand what you've suggested Sir. I just want to copy a directory+contents which resides in "/var" to a desired location of the agent servers. Can't seem to get my head around having the directory in a "module". Please can you you elaborate.

bindo gravatar imagebindo ( 2015-12-10 15:51:45 -0600 )edit

Puppet has a file server that must be configured to expose filesystem locations. See the docs:

lavaman gravatar imagelavaman ( 2015-12-10 16:27:52 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-12-10 10:24:42 -0600

Seen: 38 times

Last updated: Dec 10 '15