Issue #11159 has been updated by Josh Cooper.
Status changed from Unreviewed to Accepted
Target version set to 2.7.x
This is actually a problem with the file type's title pattern:
<pre>
def self.title_patterns
[ [ /^(.*?)\/*\Z/m, [ [ :path, lambda{|x| x} ] ] ] ]
end
</pre>
If the file name is '/', then it is not captured by the regex above, so the
:path attribute gets set to "". Later when creating a Puppet::Type::File from
the Puppet::Resource, it tries to set path to "", and the validation routine
correctly raises an error.
I could have sworn this is a duplicate of an issue I looked at last week, but I
can't find it.
----------------------------------------
Bug #11159: File resource does not work with '/' to reference root
https://projects.puppetlabs.com/issues/11159
Author: Stuart Remphrey
Status: Accepted
Priority: Low
Assignee:
Category: file
Target version: 2.7.x
Affected Puppet version: 2.6.6
Keywords:
Branch:
The File resource does not work with '/' to reference root, such as to
ensure/audit the owner, group and mode, but '/.' does work. Perhaps it is being
over-enthusiastic in removing trailing slashes?
This doesn't work:
file { '/':
ensure => directory,
owner => 0,
group => 0,
mode => 0755,
#before => *[*], # everything :-)
}
This does work -- and is a reasonable workaround (though mildly annoying and
not exactly blindingly obvious at first):
file { '/.':
...
}
--
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.