managing puppet module dependencies

2,076 views
Skip to first unread message

David Portabella

unread,
Nov 18, 2013, 11:39:27 AM11/18/13
to puppet...@googlegroups.com
with maven, you can tell that a project requires a list of artifacts and their versions.
those dependencies in turn have other dependencies.
maven takes care of managing all this.
for instance, maven can find out if two of your dependencies requires a conflicting version of another dependency.


is there a similar thing in puppet?


but it seems that you need to define yourself the direct dependencies and recursive dependencies.
and you cannot query about conflicting version dependencies.
is that correct?



Ryan Coleman

unread,
Nov 18, 2013, 11:46:57 AM11/18/13
to puppet...@googlegroups.com
On Mon, Nov 18, 2013 at 8:39 AM, David Portabella <david.po...@gmail.com> wrote:
with maven, you can tell that a project requires a list of artifacts and their versions.
those dependencies in turn have other dependencies.
maven takes care of managing all this.
for instance, maven can find out if two of your dependencies requires a conflicting version of another dependency.

Hi David, 

With the Puppet Forge, module authors are expected to express dependencies on other modules via their module metadata. The logistics for this are documented here: http://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html#dependencies-in-the-modulefile
 


is there a similar thing in puppet?


but it seems that you need to define yourself the direct dependencies and recursive dependencies.
and you cannot query about conflicting version dependencies.
is that correct?

Tools like the built-in Puppet Module Tool and librarian-puppet use that dependency metadata during installation to ensure that you have everything you need to use the module. The module tool will do its best to prevent conflicts during install and will show you what conflicts currently exist in your modulepath when you run `puppet module list`. It does not provide the ability to determine version conflicts before installing.

--
Ryan Coleman | Modules & Forge | ryanycoleman on twitter & #puppet IRC
 

David Portabella

unread,
Jan 13, 2014, 8:17:26 AM1/13/14
to puppet...@googlegroups.com
Hi Ryan,

I do as follows:

$ puppet module install puppetlabs-mysql

$ puppet module list --tree
└─┬ puppetlabs-mysql (v2.1.0)
  └── puppetlabs-stdlib (v4.1.0)


edit /Users/david/.puppet/modules/mysql/Modulefile 
and change:
  dependency 'puppetlabs/stdlib', '>= 2.2.1'
by:
  dependency 'puppetlabs/stdlib', '>= 9.9.9'

and add:
  dependency 'another_inexisting_module', '>= 1.1.1'


$ puppet module list --tree
└─┬ puppetlabs-mysql (v2.1.0)
  └── puppetlabs-stdlib (v4.1.0)

puppet does not complain about the missing dependencies.


why? 
what can be the problem?


Regards,
David

Ryan Coleman

unread,
Feb 5, 2014, 3:02:38 PM2/5/14
to puppet...@googlegroups.com

On Mon, Jan 13, 2014 at 5:17 AM, David Portabella <david.po...@gmail.com> wrote:
Hi Ryan,

I do as follows:

$ puppet module install puppetlabs-mysql

$ puppet module list --tree
└─┬ puppetlabs-mysql (v2.1.0)
  └── puppetlabs-stdlib (v4.1.0)


edit /Users/david/.puppet/modules/mysql/Modulefile 
and change:
  dependency 'puppetlabs/stdlib', '>= 2.2.1'
by:
  dependency 'puppetlabs/stdlib', '>= 9.9.9'

and add:
  dependency 'another_inexisting_module', '>= 1.1.1'


$ puppet module list --tree
└─┬ puppetlabs-mysql (v2.1.0)
  └── puppetlabs-stdlib (v4.1.0)

puppet does not complain about the missing dependencies.


why? 
what can be the problem?

Hi David. I apologize, I only now came across your reply. 

The gist of it is, Modulefile is the current input format for module metadata. During the operation of `puppet module build`, that metadata is transformed into the file metadata.json that Puppet, the Forge and other tools interact with. You saw this behavior because `puppet module list` was inspecting the metadata.json metadata, not the input file that you manipulated. 

What were you trying to accomplish with that change? Just experimenting with the dependency expressions?
Reply all
Reply to author
Forward
0 new messages