slashes or dashes for module names in metadata.json ?

96 views
Skip to first unread message

Vince Skahan

unread,
Oct 16, 2015, 6:54:15 PM10/16/15
to Puppet Users
Confused - I've seen both used in PL docs, and both used in various tools and examples.

If I'm identifying the puppetlabs stdlib into my metadata.json file as a dependency, as an example:
  • do I call it 'puppetlabs/stdlib'
  • do I call it 'puppetlabs-stdlib'
  • or is the story 'both are supported now, and will continue to be supported moving forward'

And is the story the same for all supported puppet versions (meaning 3.8.x 'and' 2015.x, and the open source variants that match each) ?


????

Thomas Müller

unread,
Oct 17, 2015, 4:29:45 AM10/17/15
to Puppet Users


Am Samstag, 17. Oktober 2015 00:54:15 UTC+2 schrieb Vince Skahan:
Confused - I've seen both used in PL docs, and both used in various tools and examples.

If I'm identifying the puppetlabs stdlib into my metadata.json file as a dependency, as an example:
  • do I call it 'puppetlabs/stdlib'
  • do I call it 'puppetlabs-stdlib'
  • or is the story 'both are supported now, and will continue to be supported moving forward'

Stefan Lasiewski

unread,
Jan 4, 2016, 5:22:37 PM1/4/16
to Puppet Users
I'm wondering the same thing. We are seeing errors when running `puppet module` commands that query for dependencies. 

I'm using the `derdanne-nfs` example below, but this error happens with at least 3 other community modules, including `thewired-bitbucket` and `puppet-mysql_java_connector`. I was unable to install certain new Puppet modules until I worked around this issue.

Puppet is complaining about missing dependencies, which is confusing because the dependencies are already there:

$ puppet --version

3.8.4

$ puppet module list >/dev/null
Warning: Missing dependency 'puppetlabs-concat':
 
'derdanne-nfs' (v0.0.7) requires 'puppetlabs-concat' (>= 1.1.2)
Warning: Missing dependency 'puppetlabs-stdlib':
 
'derdanne-nfs' (v0.0.7) requires 'puppetlabs-stdlib' (>= 4.5.0)
$

But the Puppetlabs Concat and Stdlib modules already exist and are at the proper version:

$ puppet module list |grep puppetlabs
??? puppetlabs-concat (v1.2.3)
??? puppetlabs-inifile (v1.4.2)
??? puppetlabs-pe_gem (v0.1.2)
??? puppetlabs-stdlib (v4.9.0)
$



Inside of nfs/metadata.json , I see that the dependencies are named like 'author-module', like this:


  "dependencies": [
   
{"name":"puppetlabs-stdlib","version_requirement":">= 4.5.0"},
   
{"name":"puppetlabs-concat","version_requirement":">= 1.1.2"}
 
]


If I modify the strings 'puppetlabs-stdlib' and 'puppetlabs-concact' and replace dashes with slashes:


  "dependencies": [
   
{"name":"puppetlabs/stdlib","version_requirement":">= 4.5.0"},
   
{"name":"puppetlabs/concat","version_requirement":">= 1.1.2"}
 
]


The command doesn't throw any errors:


$ puppet module list >/dev/null
$


Should metadata.json be specifying module names using hyphens or slashes? I see that the following docs recommend using dashes, not slashes:



But again, I've seen a few bugfixes which did the opposite, and resolved the error by switching from dashes to slashes. Here's one such bug:



If dashes are correct, then why is `puppet module` complaining about the derdanne-nfs module and other community modules? I'm a little curious why this problem isn't more widely reported.


Thanks for the help,


-= Stefan

Anderson Mills

unread,
Jan 5, 2016, 1:48:57 PM1/5/16
to Puppet Users
Stefan,

The answer is that dashes are preferred, but we recognized that this has been ambiguous for a long time, so the code permits both "/" and "-".

This bug (unresolved dependencies if they are specified with a "-") was addressed in PUP-3121 as you mentioned, but the fix version for that ticket is Puppet 4.0, so Puppet 3.8 does not have the fix. Unfortunately, because of that bug, dependencies with a "-" are always expressed as missing in Puppet 3.6-3.8.

Hope that clears up the situation.

Anderson
Reply all
Reply to author
Forward
0 new messages