Ask Your Question
0

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

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

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
2

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

spuder gravatar image

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

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

Comments

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

hauckd gravatar imagehauckd ( 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.

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

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

hauckd gravatar imagehauckd ( 2013-11-07 02:10:55 -0500 )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

Stats

Asked: 2013-11-06 07:05:52 -0500

Seen: 631 times

Last updated: Nov 06 '13