# How could I copy a directory tree into the root(/) directory?

I've written module and I need to copy some files into the root directory, but I always get an error: Error: Failed to apply catalog: Parameter path failed on File[/]: File paths must be fully qualified, not '' at /etc/puppet/modules/keystore/manifests/config.pp:9 Wrapped exception: File paths must be fully qualified, not ''

Here is the file resource:

    file { "/":
ensure => directory,
recurse => true,
owner => 'root',
group => 'root',
source => "puppet:///modules/keystore/${hostname}/", require => Class["keystore::install"], }  THanks ;) edit retag close merge delete ## 1 Answer Sort by » oldest newest most voted You are using recuse as true, which whill sync 'all' files in the / directory, I believe what you actually want is 'remote' http://docs.puppetlabs.com/references/latest/type.html#file-attribute-recurse Also, you stated you are placing files into the / directory, yet the resource is set to directory. I think the following should work file { '/': ensure => file, recurse => remote, owner => 'root', group => 'root', source => "puppet:///modules/keystore/${hostname}/",
require => Class["keystore::install"],
}


Update

I don't believe puppet will allow you to modify the / directory

As a test, I've verified the following:

file { 'foo':
path  => '/home/vagrant/foo,
ensure ...
more

thanks for the answer, but it doesn't work :( I get the same error

( 2013-11-06 09:35:59 -0500 )edit
1

hauckd I've done more tests and updated the answer. In short, I think puppet prevents you from modifying the / directory. Which would make sense since it could really mess things up.

( 2013-11-06 14:55:27 -0500 )edit

Ok, thanks for your answer, I'll find another way.

( 2013-11-07 02:10:55 -0500 )edit