The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com
https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:
tool should generate code using the actual module name as the directory instead of username-modulename
|Status:||Needs Decision||Start date:||12/07/2011|
|Assignee:||Ryan Coleman||% Done:|
This is what currently happens
[root@puppet modules]# puppet-module generate ghoneycutt-apache ===================================================================== Generating module at /etc/puppetlabs/puppet/modules/ghoneycutt-apache --------------------------------------------------------------------- ghoneycutt-apache ghoneycutt-apache/Modulefile ghoneycutt-apache/tests ghoneycutt-apache/tests/init.pp ghoneycutt-apache/README ghoneycutt-apache/manifests ghoneycutt-apache/manifests/init.pp ghoneycutt-apache/metadata.json ghoneycutt-apache/spec ghoneycutt-apache/spec/spec.opts ghoneycutt-apache/spec/spec_helper.rb
This is what should happen.
[root@puppet modules]# puppet-module generate ghoneycutt-apache ===================================================================== Generating module at /etc/puppetlabs/puppet/modules/apache --------------------------------------------------------------------- apache apache/Modulefile apache/tests apache/tests/init.pp apache/README apache/manifests apache/manifests/init.pp apache/metadata.json apache/spec apache/spec/spec.opts apache/spec/spec_helper.rb
People actually use the tool by doing the following, which one should not have to do.
# puppet-module generate ghoneycutt-apache && mv ghoneycutt-apache apache
#4 Updated by Garrett Honeycutt over 4 years ago
When using the install action, it already does what I proposed for the generate function. So this request will aid in consistency.
[root@puppet]# puppet-module install ghoneycutt-syslog_ng Installed "ghoneycutt-syslog_ng-1.0.0" into directory: syslog_ng
#5 Updated by Nick Fagerlund about 4 years ago
I think Garrett’s suggestion is the right one. Scaffolding a new module in one command is useful, we should be able to teach users this shortcut in the docs, and the current behavior is a bit embarrassing.
Is there ever an actual use case for creating a module folder with the fully qualified name? Why would one do that?
#6 Updated by Anonymous about 4 years ago
Part of the problem is that the generate command is very restrictive about the name of the module you’re generating. I’m working to drive Puppet modules towards a single name system, in which case the module name ‘ghoneycutt-syslog_ng’ would live in the directory ‘ghoneycutt-syslog_ng’, would be installed as ‘ghoneycutt-syslog_ng’, would be indexed on the Forge as ‘ghoneycutt-syslog_ng’, etc… (In this world, modules will eventually lose their author prefixes as well, but that’s a separate discussion…)
In the meantime, we have a world where the module ‘apache’ is “qualified” as ‘puppetlabs-apache’, lives in the ‘apache’ directory', but is referred to everyone as ‘puppetlabs-apache’ (or ‘puppetlabs/apache’). From a utilitarian perspective, generating a module into it fully qualified directory name is (presently) of limited use; you can’t actually use the module without renaming the directory. From a user perspective, there is a little sense to it: the user asked to generate ‘ghoneycutt-syslog_ng’, the created directory has the same name – they don’t need to know all of our internal rules about how qualified module names get decomposed.
The easiest thing to do (from a code-perspective) is to do nothing until the module namespace gets flattened. Having said that, I can make no promise of that happening before Puppet 3.0.0. At the very least, this is not scheduled to change as a part of Geordi v1.
#7 Updated by Gary Larizza about 4 years ago
Is there any possibility to adding an argument to ‘help’ this for experienced users? Something like: “—full-namespacing false” or “—namespacing false”? This would make the tool much more useful from a training and module development perspective RIGHT NOW, and would still work fine when the namespace is flattened?