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)
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.
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
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?
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
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?
This would be really great to have; I can already think of several use
cases where it would, personally, simplify things.
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.
{% 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.
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…
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.
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.