Issue #1503 has been updated by luke.

Status changed from Accepted to Rejected

This is intended behaviour -- /root/newfile has a failed dependency, so it 
won't be applied.  If you want this kind of behaviour, create a server-side 
empty directory and use it as the source of your copy.
----------------------------------------
Bug #1503: puppet client - require recursive purge directory does not work
http://projects.reductivelabs.com/issues/show/1503

Author: ghosty
Status: Rejected
Priority: High
Assigned to: 
Category: file
Target version: 0.24.6
Complexity: Unknown
Affected version: 0.24.5
Keywords: puppetd


Seeing this in the wiki:
http://reductivelabs.com/trac/puppet/wiki/FrequentlyAskedQuestions#i-want-to-manage-a-directory-and-purge-its-contents

Some user tried it, but required the dir to be purged before adding new files, 
asked why it did not work on irc, tested it myself, did not succeed either with 
puppetd 0.24.5 (works with puppetd 0.24.4)
In the newer puppetd a resource that does not exist gives a failure (while 
before it was only like a warning) so if you require this further down your 
recipe then it fails completely.

An example: 

puppetmaster version 0.24.5

puppetclient filesystem:
------------------------
# mkdir -p /root/dirtopurge/junkdir1
# touch /root/dirtopurge/junkfile2

puppetmaster class:
-------------------
class purgedir {
   file { "/root/dirtopurge":
      owner   => root,
      group   => root,
      purge   => true,
      recurse => true,
      force   => true,
      source  => "puppet://puppet/files/root/empty", #empty does not exist on 
fileserver, just a dummy to make it purge
   }
   file {"/root/newfile":
      owner  => root,
      group  => root,
      mode   => 644,
      require => File["/root/dirtopurge"],
      source => "puppet://puppet/files/root/newfile" #newfile does exist on 
fileserver
   }
}

puppetclient 0.24.5 messages log:
---------------------------------
Aug 10 17:05:16 puppetclient puppetd[3316]: Starting catalog run
Aug 10 17:05:16 puppetclient puppetd[3316]: 
(//Node[puppetclient.homenet.lan]/purgedir/File[/root/dirtopurge]) Failed to 
retrieve current state of resource: No specified source was found from 
puppet://puppet/files/root/empty
Aug 10 17:05:16 puppetclient puppetd[3316]: 
(//Node[puppetclient.homenet.lan]/purgedir/File[/root/dirtopurge/junkdir1]/ensure)
 removed
Aug 10 17:05:16 puppetclient puppetd[3316]: 
(//Node[puppetclient.homenet.lan]/purgedir/File[/root/dirtopurge/junkfile2]/ensure)
 removed
Aug 10 17:05:16 puppetclient puppetd[3316]: 
(//Node[puppetclient.homenet.lan]/purgedir/File[/root/newfile]) Dependency 
file[/root/dirtopurge] has 1 failures
Aug 10 17:05:16 puppetclient puppetd[3316]: 
(//Node[puppetclient.homenet.lan]/purgedir/File[/root/newfile]) Skipping 
because of failed dependencies
Aug 10 17:05:16 puppetclient puppetd[3316]: Finished catalog run in 0.38 seconds

dirtopurge is empty but /root/newfile was not created

puppetclient 0.24.4 messages log:
---------------------------------
Aug 10 17:06:50 puppetclient puppetd[3918]: Starting catalog run
Aug 10 17:06:51 puppetclient puppetd[3918]: 
(//Node[puppetclient.homenet.lan]/purgedir/File[/root/dirtopurge]/ensure) No 
specified sources exist
Aug 10 17:06:51 puppetclient puppetd[3918]: 
(//Node[puppetclient.homenet.lan]/purgedir/File[/root/dirtopurge]/ensure) No 
specified sources exist
Aug 10 17:06:51 puppetclient puppetd[3918]: 
(//Node[puppetclient.homenet.lan]/purgedir/File[/root/dirtopurge]/source) No 
specified sources exist
Aug 10 17:06:51 puppetclient puppetd[3918]: 
(//Node[puppetclient.homenet.lan]/purgedir/File[/root/dirtopurge]/checksum) 
checksum changed '{mtime}Sun Aug 10 17:05:16 +0200 2008' to '{mtime}Sun Aug 10 
17:06:46 +0200 2008'
Aug 10 17:06:51 puppetclient puppetd[3918]: 
(//Node[puppetclient.homenet.lan]/purgedir/File[/root/dirtopurge/junk1]/ensure) 
removed
Aug 10 17:06:51 puppetclient puppetd[3918]: 
(//Node[puppetclient.homenet.lan]/purgedir/File[/root/dirtopurge/junkdir]/ensure)
 removed
Aug 10 17:06:51 puppetclient puppetd[3918]: 
(//Node[puppetclient.homenet.lan]/purgedir/File[/root/newfile]/ensure) created
Aug 10 17:06:51 puppetclient puppetd[3918]: Finished catalog run in 0.71 seconds

dirtopurge is empty and /root/newfile is created


----------------------------------------
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to