Feature #6368
File type should autorequire all parents
| Status: | Closed | Start date: | 02/18/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | file | |||
| Target version: | 2.7.0 | |||
| Affected Puppet version: | Branch: | |||
| Keywords: | type file autorequire | |||
| Votes: | 1 |
Description
This is an RFC feature request. I think I’d like the file type to autorequire not only its parent directory, but any parent directories which appear in the catalog.
My concrete use case involves packages which install directory hierarchies. For example, the cobbler RPM installs /var/lib/cobbler, /var/lib/cobbler/kickstarts, /var/lib/cobbler/snippets, /var/lib/cobbler/triggers, &c. I install the Cobbler package in one module, and install Cobbler kickstarts and snippets in several other places. Rather than adding require => Package['cobbler'] to these numerous and disparate file resources, I’d rather put this in my cobbler module:
package { 'cobbler': ensure => present }
file { '/var/lib/cobbler':
ensure => directory,
require => Package['cobbler'],
}
And have that be a way of saying, “The /var/lib/cobbler hierarchy is created by the cobbler RPM; please treat the package as a (transitive) requirement for any files installed under this hierarchy.” (I’d prefer to specify this information once, and to specify it in the cobbler module itself.)
The only downsides I can think of are (1) some superfluous relationships in catalogs that define dense hierarchical file resources, and (2) the outside possibility of creating cycles in existing (probably bizarre) catalogs.
If this behavior seems desirable, I’ve got a tiny patch which implements it, and I should be able to add some tests fairly easily.
(Incidentally, this feature would resolve issue #3648 pretty cleanly.)
Related issues
History
Updated by David Schmitt over 1 year ago
It would be sufficient to require the first managed parent instead of all managed parents. That would lead to the intended stronger ordering without creating more than the absolutely necessary edges.
Updated by Ian Ward Comfort over 1 year ago
Yes, that would be sufficient. Any ideas on how to implement that?
Updated by Ian Ward Comfort over 1 year ago
After dev list discussion this feature was revised to “File type should autorequire its nearest ancestor directory”. I’ve got a first draft implementation here:
git://github.com/icomfort/puppet.git file-autorequire-first-ancestor
Updated by James Turnbull about 1 year ago
- Status changed from Unreviewed to Needs Decision
- Assignee set to Nigel Kersten
Updated by Nigel Kersten about 1 year ago
- Status changed from Needs Decision to Accepted
- Assignee deleted (
Nigel Kersten)
Updated by Nigel Kersten about 1 year ago
- Target version set to 2.7.x
Updated by Jacob Helwig about 1 year ago
- Status changed from Accepted to Merged - Pending Release
Merged into 2.7.next in commit:89620ab51997e032ccde218de13acab9f55da4b8
Updated by James Turnbull 11 months ago
- Status changed from Merged - Pending Release to Closed
- Target version changed from 2.7.x to 2.7.0