Issue #3180 has been updated by James Turnbull.

Target version changed from 0.25.5 to 0.25.6


----------------------------------------
Bug #3180: Cannot set a file resource to absent if there is a source and 
recurse => true
http://projects.puppetlabs.com/issues/3180

Author: Peter Meier
Status: Accepted
Priority: Normal
Assigned to: 
Category: file
Target version: 0.25.6
Affected version: 0.25.4
Keywords: 
Branch: 


Given the following manifest:

<pre>
$ cat foo.pp 

file{'/tmp/a':
  ensure => absent,
  source => '/tmp/b/',
  recurse => true,
  purge => true,
  force => true,
}
</pre>

and the following setup:

<pre>
$ find /tmp/b
/tmp/b
/tmp/b/.ignore
$ ls -l /tmp/a
ls: /tmp/a: No such file or directory
</pre>

I get the following message:

<pre>
$ puppet foo.pp 
err: /File[/tmp/a/.ignore]/ensure: change from absent to file failed: Could not 
set file on ensure: No such file or directory - /tmp/a/.ignore
</pre>

It looks like puppet tries to copy the source even if @ensure@ is set to 
@abs...@. Commenting the source out works.

This is a bit annoying, as puppeteers might have such a resource often in a 
define and simply pass the @ensure@ from the define to the file source, like:

<pre>
$ cat foo.pp 
define foo($ensure = 'present'){
  file{'/tmp/a':
    ensure => $ensure,
    source => '/tmp/b/',
    recurse => true,
    purge => true,
    force => true,
  }
}
</pre>


-- 
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://projects.puppetlabs.com/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