Ask Your Question

Can metadata.json include dependencies of git modules

asked 2016-08-31 14:40:41 -0500

Module 'A' depends on module 'B' and they both are in git - Is there a way to include them in metadata.json - Or does metadata.json only accept dependencies of modules that are in the puppet forge? Please provide examples. Thank you!

edit retag flag offensive close merge delete


Are you talking about execution order of modules in terms of prerequisite or using code of module A in module B, like we do for standard libraries?

rajeevsharma gravatar imagerajeevsharma ( 2016-08-31 17:16:12 -0500 )edit

It's more of one module as a prerequisite for another module.

Redsmile gravatar imageRedsmile ( 2016-09-01 09:06:30 -0500 )edit

1 answer

Sort by » oldest newest most voted

answered 2016-09-03 18:41:31 -0500

updated 2016-09-21 19:17:24 -0500

puppet docs: latest refererence on modules metadata § example

"dependencies" is an Array[Struct[{name => String[1], version_requirement => String[1]}]]

The name attribute has to [or at least should] match a module's name (what's written in its metadata.json).

So in your case metadata.json of your module redsmile/A contains:

"dependencies": [
  {"name": "redsmile-B", "version_requirement": "> 0.0.0 < 1.0.0"}

whereas the metadata.json of the module redsmile/B

"name": "redsmile-B",

Where and how the module's are stored is irrelevant for the metadata.json. You can provide a link in your where needed modules can be retrieved, or, for convenience, upload them to puppet forge, since that let's you just puppet module install redsmile-A automatically fetching required modules.

edit flag offensive delete link more


I Think the OP is asking about modules that are NOT forge modules, that are only stored in source control. Some module managers (r10k/puppet-librarian/code deploy?) support a Puppetfile for module dependency resolution, which includes git repositories. I don't believe it is in the current metadata.

DarylW gravatar imageDarylW ( 2016-09-06 09:25:23 -0500 )edit

Yes, I'm asking about modules that are NOT forge modules. For certain legitimate reasons, it couldn't be uploaded to forge but would still need to be in house. I don't think metadata.json supports anything other than puppet forge modules. Thanks for the insight though. Appreciate it.

Redsmile gravatar imageRedsmile ( 2016-09-06 10:58:01 -0500 )edit

Yes, AFAIK the PMT (puppet module tool) does only resolve dependencies for modules their dependencies are hosted at Forge, too. And, as far as I've looked, it can handle at most one module_repository URI. That's where modules as packages *.deb *.rpm *.yum can become handy.

Kai Burghardt gravatar imageKai Burghardt ( 2016-09-06 17:23:40 -0500 )edit

Yes, all that i read suggests that metadata.json is purely for puppet forge modules only.

Redsmile gravatar imageRedsmile ( 2016-09-21 13:37:36 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-08-31 14:40:41 -0500

Seen: 64 times

Last updated: Sep 21 '16