Ask Your Question

module dependency best practices ?

asked 2013-10-05 04:33:53 -0600

doc75 gravatar image

updated 2013-10-05 15:43:13 -0600

Stefan gravatar image


I am creating some modules and sometimes I have dependency which I do not like.

Let's take as an example that I have 2 modules:

  • ssh module
  • Fail2ban module (with a define to setup some rules)

What I want to be able to do is to ensure that IF fail2ban is declared on the node AND IF ssh module is also declared on the node, THEN the ssh fail2ban rules is activated.

I started by setting the fail2ban rule in ssh module (using fail2ban define), but then if fail2ban is not activated on the node, it fails. I ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-10-05 07:15:01 -0600

golja gravatar image

updated 2013-10-05 15:41:51 -0600

Stefan gravatar image

Have a look at the defined function which can help you to solve your issue, but definitely you will need to modify the existing modules.

In general when defining your node manifests you should follow the role and profile class definition pattern. For more information I would recommend to read this article:

edit flag offensive delete link more


Thanks golja, I'll have a look. I have no issue modifying my modules, I would like to do it the right way this time ;-) The first problem I can ...(more)

doc75 gravatar imagedoc75 ( 2013-10-05 07:32:21 -0600 )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: 2013-10-05 04:33:53 -0600

Seen: 233 times

Last updated: Oct 05 '13