Ask Your Question

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

asked 2013-11-06 07:05:52 -0600

hauckd gravatar image

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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-11-06 09:13:46 -0600

spuder gravatar image

updated 2013-11-06 14:54:13 -0600

You are using recuse as true, which whill sync 'all' files in the / directory, I believe what you actually want is 'remote'

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"],


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 ...
edit flag offensive delete link more


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

hauckd gravatar imagehauckd ( 2013-11-06 09:35:59 -0600 )edit

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.

spuder gravatar imagespuder ( 2013-11-06 14:55:27 -0600 )edit

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

hauckd gravatar imagehauckd ( 2013-11-07 02:10:55 -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: 2013-11-06 07:05:52 -0600

Seen: 801 times

Last updated: Nov 06 '13