Issue #4806 has been updated by Luke Kanies.

Status changed from Needs design decision to Accepted
Assignee deleted (Luke Kanies)

It's happening because it's easier to always add the autorequire than to think 
about it.

Seems like a good conditional to add.
----------------------------------------
Bug #4806: file-resource: useless autorequire 
http://projects.puppetlabs.com/issues/4806

Author: Benedikt Köppel
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected version: 0.25.5
Keywords: 
Branch: 


file-ressource: useless autorequire when ensure => absent

I have a file resource like that:
<pre>
file { '/home/$user':
  owner => $user,
  ensure => $ensure
} 
</pre>

with $user and $ensure filled by a define "account"

When I now set account { 'beni': ensure => absent }, puppet still generates a 
autorequire => User['beni'], even though the file /home/beni doesn't need that 
user.

A workaround is this:
<pre>
file { '/home/$user':
  owner => $ensure ? {
    present => $user,
    absent => []
  }
  ensure => $ensure
}
</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