# New module idea brainstorming

**URL:** <https://forum.ansible.com/t/new-module-idea-brainstorming/12828>\
**Category:** Ansible Project\
**Created:** [May 19, 2013, 2:01pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828 "2013-05-19T14:01:26Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [May 19, 2013, 2:01pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/1 "2013-05-19T14:01:26Z")

</div>

Hi everyone,

Thinking about what you manage with Ansible, or would like to, and what modules we have in 1.2 so far, what are some of other modules you would like to see in Ansible that we haven’t added yet?

(There is still a bit of time in 1.2, but I’m also thinking forward to future releases)

---

<div class="post-metadata">

**Author:** ![Kavin\_Kankeshwar](https://avatars.discourse-cdn.com/v4/letter/k/35a633/32.png) [@Kavin\_Kankeshwar](https://forum.ansible.com/u/Kavin_Kankeshwar)\
**Post date:** [May 20, 2013, 12:48am UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/2 "2013-05-20T00:48:56Z")

</div>

I am sure many people need “until” module, which in principle is similar to “wait\_for” module. Have seen many discussions about it.

This module would will look for any arbitrary statistics, like look/tail log file (maybe use logcheck/logtail) for certain line or value to be matched or call another system program and check/compare the value returned.

If i had to think about implementation, Still very fuzzy in my head, it would be have a regex/filter match for key:value, additionally a flag for serial or parallel, Command to use get statistics/strings etc. like get value from a webservice on each host or any other tool installed which can return some value based on the request.

Would be great if this module can wait for all hosts to meet the condition and then proceed or be in rolling upgrade fashion.

An actual usecase for us is:

- Run “clinfo -l -v statistics” command on the machine (A tool which talks to Aerospike Database),
- Grep/filter/regex for a key and get key=value, returned.
- Compare value to either match or exceed or less than the desired value.  
I am willing to do/help with this, but this is very custom to us, Hence would be nice to have feedback on how make it as general as possible to be used by everyone.

Regards,

---

<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:** [May 20, 2013, 1:33am UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/3 "2013-05-20T01:33:35Z")

</div>

Yeah, I’ve been talking about this with many different folks, though I was thinking of doing it more like this, as a language feature:

- shell: /usr/bin/somecommand blarg  
register: foo  
until: foo.stdout.find(“haystack”) != -1  
delay: 15 # wait this many seconds before trying again  
tries: 5 # fail after this many tries

Thoughts?

---

<div class="post-metadata">

**Author:** ![James\_Martin2](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@James\_Martin2](https://forum.ansible.com/u/James_Martin2)\
**Post date:** [May 20, 2013, 1:24pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/4 "2013-05-20T13:24:07Z")

</div>

MIchael,

I think that is a very clean solution, and fits all (of my) use cases.

- James

---

<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:** [May 20, 2013, 1:28pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/5 "2013-05-20T13:28:49Z")

</div>

I would love to see an idempotent “patch” module. If I had more time, I’d write it myself, but alas I haven’t had the cycles.

Lorin

---

<div class="post-metadata">

**Author:** ![Patrick\_Regan](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@Patrick\_Regan](https://forum.ansible.com/u/Patrick_Regan)\
**Post date:** [May 20, 2013, 1:37pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/6 "2013-05-20T13:37:18Z")

</div>

I’d love to see some idempotent Gluster module, but I have no idea how it could be done. This is fairly low priority for me though. It’s possible in the near future I’ll have time to at least look into a strategy behind it.

I’m also curious if anyone has any ideas for Drupal configuration via Ansible. Should there be a new module for it, or try to make upgrades/updates work via already implemented modules?

---

<div class="post-metadata">

**Author:** ![C\_Morgan\_Hamill](https://avatars.discourse-cdn.com/v4/letter/c/ebca7d/32.png) [@C\_Morgan\_Hamill](https://forum.ansible.com/u/C_Morgan_Hamill)\
**Post date:** [May 20, 2013, 1:55pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/7 "2013-05-20T13:55:39Z")

</div>

Excerpts from Michael DeHaan's message of 2013-05-19 21:33:35 -0400:

> Yeah, I've been talking about this with many different folks, though I was  
> thinking of doing it more like this, as a language feature:
> 
> - shell: /usr/bin/somecommand blarg  
> &nbsp;&nbsp;&nbsp;register: foo  
> &nbsp;&nbsp;&nbsp;until: foo.stdout.find("haystack") != -1  
> &nbsp;&nbsp;&nbsp;delay: 15 # wait this many seconds before trying again  
> &nbsp;&nbsp;&nbsp;tries: 5 # fail after this many tries
> 
> Thoughts?

This would be really great to have; I can already think of several use  
cases where it would, personally, simplify things.

---

<div class="post-metadata">

**Author:** ![Hudec\_Peter](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@Hudec\_Peter](https://forum.ansible.com/u/Hudec_Peter)\
**Post date:** [May 20, 2013, 1:57pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/8 "2013-05-20T13:57:35Z")

</div>

Hi,

I would like to see module, that manages user groups /supplemetary/.  
The user module is good for creating users and adding them to groups /with append=yes/, but there is no way how to remove user from group.

In this module would be 3 states  
State = enables, means, the user is is these groups  
State = absent, the user is not in these groups  
State = only = the user is only in these groups

I had no time to do this. It should be very easy to to it, while the use remodel already sdo some stuff. 😉

Peter

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [May 20, 2013, 2:01pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/9 "2013-05-20T14:01:36Z")

</div>

​+1  
​

---

<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:** [May 20, 2013, 2:50pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/10 "2013-05-20T14:50:19Z")

</div>

how about an opennebula inventory/facts plugin?

---

<div class="post-metadata">

**Author:** ![Edgars](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@Edgars](https://forum.ansible.com/u/Edgars)\
**Post date:** [May 20, 2013, 7:14pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/11 "2013-05-20T19:14:35Z")

</div>

Idempotent rpm/dpkg module.  
Extended raw module which allows to use Expect script style syntax and capabilities.

Edgars

---

<div class="post-metadata">

**Author:** ![GW1](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@GW1](https://forum.ansible.com/u/GW1)\
**Post date:** [May 20, 2013, 8:02pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/12 "2013-05-20T20:02:13Z")

</div>

Hi,

+1 for “patch” module, either regexp oriented or multi-line-oriented with Jinja2 constructs

Actually it is already possible to implement the multi-line-oriented approach with a hack and some Jinja2+Python magic like this:

- name: read network/interfaces content  
command: /bin/cat /etc/network/interfaces  
register: read\_interfaces\_content
- name: configure network/interfaces  
template: src=network/interfaces.j2 dest=/etc/network/interfaces owner=root group=root mode=0644

And than snippet for “network/interfaces.j2”:

{% for line in read\_interfaces\_content.stdout.split(‘\n’) if not skip\_all -%}

{% if line.startswith(‘# Ansible’) %}  
{%- set skip\_all = True %}  
{% elif line == ‘auto eth0’ %}  
{%- set skip\_line = True %}  
{% elif line.startswith('iface eth0 inet ') %}  
{%- set skip\_section = True %}  
{% elif line == ‘’ %}  
{%- set skip\_section = False %}  
{% endif -%}

{% if skip\_all %}  
{% elif skip\_line or skip\_section %}  
{%- set skip\_line = False %}  
#{{ line }}  
{% else %}  
{{ line }}  
{% endif -%}

{% endfor %}

# {{ ansible\_managed }}

auto eth0  
iface eth0 inet dhcp

# ..put your other content here that will appear on the end of the network/interfaces file..

By redesigning it any patching can be done with such an approach, but it gets really quickly really ugly… Therefore a “patch” module that could replace this would be much appreciated.

Greetings,  
gw

---

<div class="post-metadata">

**Author:** ![GW1](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@GW1](https://forum.ansible.com/u/GW1)\
**Post date:** [May 20, 2013, 8:16pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/13 "2013-05-20T20:16:03Z")

</div>

Hm, there could also be a syntax-checking module in case you just want to ensure that some configuration files are in correct format before finalizing the deployment that will fail.

Such a module should probably use grammars (generalization of regular expressions) for syntax definitions. BNF notation is commonly used in protocol descriptions, but afaik it is only human readable. A good grammar parsing implementation is implemented in Perl6, where grammars are first-class programming constructs, like regexs, strings, integers…

- [https://en.wikibooks.org/wiki/Perl\_6\_Programming/Grammars](https://en.wikibooks.org/wiki/Perl_6_Programming/Grammars)
- [https://en.wikipedia.org/wiki/Context-free\_grammar](https://en.wikipedia.org/wiki/Context-free_grammar)
- [https://en.wikipedia.org/wiki/Backus%E2%80%93Naur\_Form](https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form)

Writing grammars usually isn’t so trivial, therefore a database of commonly used (eg. for valid apache, nginx, pgsql, mongodb… configuration files) should probably be included with the module.

Greetings,  
gw

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [May 20, 2013, 8:16pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/14 "2013-05-20T20:16:11Z")

</div>

So, question…

Why would we need a rpm/dpkg module when we have an apt/yum module?

Your raw question is a little interesting.

(If you are trying to manipulate a device, may I ask which device?)

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [May 20, 2013, 8:16pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/15 "2013-05-20T20:16:48Z")

</div>

As for syntax checking, there is already the validate option on the copy/template module you could use for this.

How it can call visudo is shown in the docs.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [May 20, 2013, 8:17pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/16 "2013-05-20T20:17:13Z")

</div>

Sounds good.

If you build it, I’ll definitely include it in examples/plugins.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [May 20, 2013, 8:18pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/17 "2013-05-20T20:18:40Z")

</div>

There are various folks here that are deploying Drupal.

The one I’m thinking of mainly, the Four Kitchens stuff seems to be more about dev environments though.

[https://github.com/fourkitchens/server-playbooks/blob/master/ubuntu-12.04-lamp-dev/setup.yml](https://github.com/fourkitchens/server-playbooks/blob/master/ubuntu-12.04-lamp-dev/setup.yml)

Any comments, Mark?

---

<div class="post-metadata">

**Author:** ![Edgars](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@Edgars](https://forum.ansible.com/u/Edgars)\
**Post date:** [May 20, 2013, 9:09pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/18 "2013-05-20T21:09:46Z")

</div>

1. To deploy self-made packages.
2. Cisco switches, HP iLO, Dell Drac, SUN ILOM, etc.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [May 20, 2013, 10:04pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/19 "2013-05-20T22:04:38Z")

</div>

Ok, so for 1, you can easily just set up your own repository. I highly recommend folks do that. Yum can also install an RPM directly.

As for 2, various answers.

I’m waiting on Cisco to release good remote APIs for various hardware, but suspect it will be a while. A action module that knows how to parse the CLI would be terrible, but is I think as good as we can get.

As for ILO, depends what you want to do, but the basic fence scripts around that stuff are pretty easy and straight forward.

Where things have APIs and libraries, a good ‘local\_action’ module is the best way to deal with them, rather than trying to screen scrape.

---

<div class="post-metadata">

**Author:** ![aamaas](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@aamaas](https://forum.ansible.com/u/aamaas)\
**Post date:** [May 21, 2013, 1:20pm UTC](https://forum.ansible.com/t/new-module-idea-brainstorming/12828/20 "2013-05-21T13:20:47Z")

</div>

Hi,

ACL support for the file module. I’m amazed that everyone seems to get by using only owner and group.

Regards,  
Harald

[Next page](https://forum.ansible.com/t/new-module-idea-brainstorming/12828.md?page=2)
