# Module 'requirements'

**URL:** <https://forum.ansible.com/t/module-requirements/12501>\
**Category:** Ansible Project\
**Created:** [March 14, 2013, 10:40am UTC](https://forum.ansible.com/t/module-requirements/12501 "2013-03-14T10:40:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpmens1](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@jpmens1](https://forum.ansible.com/u/jpmens1)\
**Post date:** [March 14, 2013, 10:40am UTC](https://forum.ansible.com/t/module-requirements/12501/1 "2013-03-14T10:40:12Z")

</div>

I was glancing at some of the new modules (e.g. the 'rabbit\_\*' stuff)  
and I noticed the 'requirements' in the DOCUMENTATION string are empty.  
In other words, it would seem to me that the module is self-sufficient,  
which it isn't: it needs the rabbitmqctl program.

I then checked get\_url, which I originally wrote, and therein it says:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;requirements: [urllib2, urlparse]

which is cool, but I find no further use of 'requirements' when we  
generate the docs, which is NOT cool; mea culpa!

If you agree, I think we should require 'requirements' 😉 so that  
people know what the module needs to run, and I'll take it upon myself  
to munge that into the doc generators.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-JP

---

<div class="post-metadata">

**Author:** ![Jimmy\_Tang](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@Jimmy\_Tang](https://forum.ansible.com/u/Jimmy_Tang)\
**Post date:** [March 14, 2013, 10:43am UTC](https://forum.ansible.com/t/module-requirements/12501/2 "2013-03-14T10:43:56Z")

</div>

+1, It'd be even nicer if the requirements specified where they are  
needed. i.e. is it required on the target or on the manager machine?

Jimmy.

---

<div class="post-metadata">

**Author:** ![jpmens1](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@jpmens1](https://forum.ansible.com/u/jpmens1)\
**Post date:** [March 14, 2013, 11:37am UTC](https://forum.ansible.com/t/module-requirements/12501/3 "2013-03-14T11:37:57Z")

</div>

> +1, It'd be even nicer if the requirements specified where they are  
> needed. i.e. is it required on the target or on the manager machine?

Good catch! Maybe

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;requirements\_manager: [a,b]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;requirements\_host: [c, d]

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-JP

---

<div class="post-metadata">

**Author:** ![Chris\_Hoffman](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@Chris\_Hoffman](https://forum.ansible.com/u/Chris_Hoffman)\
**Post date:** [March 14, 2013, 12:37pm UTC](https://forum.ansible.com/t/module-requirements/12501/4 "2013-03-14T12:37:29Z")

</div>

The reason I didn’t add any requirements to the rabbitmq\* modules was because I thought it would be implied since that utility comes with RabbitMQ itself and therefore would be installed with the host you are managing. I am fine with being explicit about it and will add the information.

---

<div class="post-metadata">

**Author:** ![jpmens1](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@jpmens1](https://forum.ansible.com/u/jpmens1)\
**Post date:** [March 14, 2013, 12:49pm UTC](https://forum.ansible.com/t/module-requirements/12501/5 "2013-03-14T12:49:53Z")

</div>

> I am fine with being explicit about it and will add the information.

Just to clarify, I wasn't picking on \*you\*, Chris. 🙂

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-JP

---

<div class="post-metadata">

**Author:** ![Lorin\_Hochstein1](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@Lorin\_Hochstein1](https://forum.ansible.com/u/Lorin_Hochstein1)\
**Post date:** [March 14, 2013, 12:58pm UTC](https://forum.ansible.com/t/module-requirements/12501/6 "2013-03-14T12:58:29Z")

</div>

+1, I got burned the other day because I forgot to install the requirements for the apt-repository module.

Oddly, the docstring for that module, says it requires python-apt, and the unstructured notes at the bottom say that it requires python-software-properties.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [March 14, 2013, 1:43pm UTC](https://forum.ansible.com/t/module-requirements/12501/7 "2013-03-14T13:43:48Z")

</div>

Not backward compatible, JP.

requirements: # managed node requirements  
control\_requirements: # control machine requirements

perhaps. Make it so!

---

<div class="post-metadata">

**Author:** ![jpmens1](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@jpmens1](https://forum.ansible.com/u/jpmens1)\
**Post date:** [March 14, 2013, 2:40pm UTC](https://forum.ansible.com/t/module-requirements/12501/8 "2013-03-14T14:40:18Z")

</div>

> Not backward compatible, JP.

Point.

> requirements: # managed node requirements  
> control\_requirements: # control machine requirements
> 
> perhaps. Make it so!

Your wish, is my pull-request. It will be done!

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-JP

---

<div class="post-metadata">

**Author:** ![jpmens1](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@jpmens1](https://forum.ansible.com/u/jpmens1)\
**Post date:** [March 14, 2013, 6:14pm UTC](https://forum.ansible.com/t/module-requirements/12501/9 "2013-03-14T18:14:50Z")

</div>

PR submitted.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-JP

---

<div class="post-metadata">

**Author:** ![Chris\_Hoffman](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@Chris\_Hoffman](https://forum.ansible.com/u/Chris_Hoffman)\
**Post date:** [March 14, 2013, 10:27pm UTC](https://forum.ansible.com/t/module-requirements/12501/10 "2013-03-14T22:27:54Z")

</div>

I know, it was a good example. 🙂 It was something I did think about though.

---

<div class="post-metadata">

**Author:** ![crucialfelix](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@crucialfelix](https://forum.ansible.com/u/crucialfelix)\
**Post date:** [March 16, 2013, 2:04pm UTC](https://forum.ansible.com/t/module-requirements/12501/11 "2013-03-16T14:04:06Z")

</div>

I’ve just configured and installed rabbit and used your modules. I wouldn’t (and didn’t) expect it to auto install rabbitmq-server.

I’m using the normal apt package distribution, but there have been cases in the past where we needed to install a specific version of rabbitmq, so I would leave the choice of installation to the user.

or maybe if its installed then the requirements are satisfied and it does nothing.
