Bug #3648
autorequire failure with subdirectory inside recursive file resource
| Status: | Closed | Start date: | 04/21/2010 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | file | |||
| Target version: | 2.7.12 | |||
| Affected Puppet version: | 0.25.4 | Branch: | ||
| Keywords: | ||||
| Votes: | 0 |
Description
If you have a file resource that recursively creates a directory hierarchy, and another file resource that stores a file somewhere in that directory hierarchy, then the two resources may be evaluated in the wrong order. The autorequire handling, which usually causes a file to require its parent directory, doesn’t work in this case.
class myclass {
file { "/topdir/subdir/filename":
ensure => file,
content => "testing",
# autorequires File["/topdir/subdir"], but doesn't notice
# that /topdir/subdir is actually created by recursion in
# the File["/topdir"] resource.
}
file { "/topdir":
ensure => directory,
recurse => inf,
source => "puppet:///myclass/topdir",
# assuming /myclass/files/topdir exists
# on the puppetmaster, and assuming it contains
# the "subdir" subdirectory, this resource
# will create "/topdir/subdir" on the client,
# but this sometimes happens too late for files
# that should live in that subdirectory.
}
}
Related issues
History
Updated by James Turnbull about 2 years ago
- Category set to file
- Status changed from Unreviewed to Accepted
- Assignee set to Jesse Wolfe
- Target version set to 2.7.x
Updated by Joshua Lifton 5 months ago
- Assignee deleted (
Jesse Wolfe)
This issue was assigned to a former Puppet Labs employee. Adding back to the pool of unreviewed issues.
Updated by Ben Hughes 4 months ago
- Description updated (diff)
- Status changed from Accepted to Unreviewed
Updated by Luke Kanies 4 months ago
- Description updated (diff)
- Status changed from Unreviewed to Closed
This appears to work as expected now.
Updated by Daniel Pittman 2 months ago
- Target version changed from 2.7.x to 2.7.12