Refactor #7604
Import should also include subdirectories
| Status: | Rejected | Start date: | 05/20/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - | |||
| Affected Puppet version: | Branch: | |||
| Keywords: | puppetcamp-eu-2011 | |||
| Votes: | 0 |
Description
I.e.,
import "/etc/puppet/manifests/nodes/*"
Should import all manifests in subdirectories as well.
Note that this conflicts with #4732, which proposes that Puppet globs act more like shell globs.
—
This ticket is a request for comment, coming out of a discussion at Puppet Camp EU, 2011. No promises whatever about implementation, but there were enough people interested to open a public discussion.
History
Updated by Daniel Pittman about 1 year ago
I think this is a bad idea, especially because using import is a sign that you have violated the expectations of the autoloader; those conventions are valuable to everyone using Puppet.
I could be convinced to support the extended version of globs that Ruby supports:
import "/etc/puppet/nodes/*" # only that directory
import "/etc/puppet/nodes/**/*" # that directory and any children
Updated by R.I. Pienaar about 1 year ago
Does the autoloader support loading node files by convention? I am not aware of this. So I wouldnt agree with your assertion that using it is a sign of not following conventions.
Updated by Daniel Pittman 12 months ago
R.I. Pienaar wrote:
Does the autoloader support loading node files by convention? I am not aware of this. So I wouldnt agree with your assertion that using it is a sign of not following conventions.
Good catch: I was thinking only of the case of import in the scope of classes and modules, not nodes. We don’t currently define a best practice solution to loading nodes by convention from disk. (Though that might be a good idea.)
Thinking about it, I stand by the rest of my statement: I would happily support an explicit “recurse” operation in import, but oppose an implicit “always recurse”. Even in the case of nodes split out separately, which is reasonable, having to be explicit about recursive importing makes more sense, I think.
Updated by Felix Frank 12 months ago
I see no way of retaining backwards compatibility, and possible nastiness in store for past users of this syntax.
On the other hand, I dearly hope that there are few users that span whole trees of node manifests (but I may be wrong to).
In all, I think I’m opposed to this.
Updated by Luke Kanies 12 months ago
I think the idea of doing this automatically with a plain glob is horrible and should be summarily rejected.
Supporting a ruby-like ‘**’ glob is reasonable, but I prefer to develop a convention for loading nodes and keep importing very simple (or just deprecate nodes).
Updated by Nigel Kersten 3 months ago
- Status changed from Investigating to Rejected
We’re rejecting this as we’re actually looking to deprecate import as per #12929
Even without that, the only way we’d support this would be via a more familiar mechanism such as extended globbing.