puppet agent -t rerun error

asked 2014-12-16 09:18:51 -0600

sushi1992 gravatar image

updated 2014-12-16 20:42:28 -0600

GregLarkin gravatar image

Hi All,

This is my first post so i hope it's informative. I have a little issue with my puppet code. I've ran "puppet agent -t" on my puppet agent and the first time round it was successful. I ran it again and i got an error:

Notice: /Stage[main]/Asg/File[/ert-asg/data]: Not removing directory; use 'force' to override
Notice: /Stage[main]/Asg/File[/ert-asg/data]: Not removing directory; use 'force' to override
Error: Could not remove existing file
Error: /Stage[main]/Asg/File[/ert-asg/data]/ensure: change from directory to link failed: Could not remove existing file

I have a class which is meant to create a directory (2 directories anyway) and link the sub-directory with a symbolic link (symlink). The code is as follows:

class eca(
    $eca_directory = "/ert-eca",
    include eca::packages

    file { "${eca_directory}":
        ensure => directory

    file { "${eca_directory}/data":
        ensure => 'link',
        target => "/ECA_Sym",

Any chances why the above code works first time round i.e. creates directories and symlinks it, but yet second time round i get the above error.

Any help would be appreciated - thanks!

edit retag flag offensive close merge delete


Anyone? Really need help with this...

sushi1992 gravatar imagesushi1992 ( 2014-12-16 14:30:58 -0600 )edit

Is there anything on the system that's managing or modifying that directory tree, like a mkdir somewhere in your Puppet code or elsewhere? Can you pastebin the output of the first agent run (clean system), a directory listing showing the symlink, output of a 2nd agent run and the dir listing again?

GregLarkin gravatar imageGregLarkin ( 2014-12-16 20:50:05 -0600 )edit