The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Feature #6368

File type should autorequire all parents

Added by Ian Ward Comfort about 5 years ago. Updated almost 5 years ago.

Status:ClosedStart date:02/18/2011
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:file
Target version:2.7.0
Affected Puppet version: Branch:
Keywords:type file autorequire

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com


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

Related to Puppet - Bug #3648: autorequire failure with subdirectory inside recursive fi... Closed 04/21/2010

History

#1 Updated by David Schmitt about 5 years 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.

#2 Updated by Ian Ward Comfort about 5 years ago

Yes, that would be sufficient. Any ideas on how to implement that?

#3 Updated by Ian Ward Comfort about 5 years 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

#4 Updated by James Turnbull about 5 years ago

  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Nigel Kersten

#5 Updated by Nigel Kersten about 5 years ago

  • Status changed from Needs Decision to Accepted
  • Assignee deleted (Nigel Kersten)

#6 Updated by Nigel Kersten about 5 years ago

  • Target version set to 2.7.x

#7 Updated by Jacob Helwig about 5 years ago

  • Status changed from Accepted to Merged - Pending Release

Merged into 2.7.next in commit:89620ab51997e032ccde218de13acab9f55da4b8

#8 Updated by James Turnbull almost 5 years ago

  • Status changed from Merged - Pending Release to Closed
  • Target version changed from 2.7.x to 2.7.0

Also available in: Atom PDF