Ask Your Question

Resource ordering within a module dependant on other module

asked 2014-01-06 09:38:13 -0500

jaksky gravatar image

This question is more about a curiosity and let say clear module design.

Suppose that I have a module A which contains classes a,b and c. Next module B contains only class a.

Let say that A-b requires B-a to be run first.

I don't want to spoil module A with declaration of B-a as that should be probably defined in profile specification. I would like to keep module clear and without possibility of introducing circular references etc.

I would imagine something like this (but that for some reason doesn't work for me):

class role1{
include B ...
edit retag flag offensive close merge delete


This question would make far more sense if you used a real example in stead of A, B, C. I would also recommend using something like standard Puppet classes like ...(more)

ramindk gravatar imageramindk ( 2014-01-06 12:46:24 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-01-15 23:12:27 -0500

rjc gravatar image

include is for declaring a class - what you're after is contain, and that's only for puppet >= 3.4.0. You can of course use inherits.

More info can be found in the Style Guide.

edit flag offensive delete link more

answered 2014-04-09 19:17:25 -0500

Here's a more concrete example, one I have at the moment.

I have a module for creating a user.

I have another module that does some stuff, but this stuff depends on that user being created.

How can I define it such that the second module requires the first module?

It's like class dependency, but instead it's module dependency.

Unless I can simply require the class defined in another module? Is that the way to do it?

edit flag offensive delete link more

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: 2014-01-06 09:38:13 -0500

Seen: 377 times

Last updated: Apr 09 '14