--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
- shell: /usr/bin/somecommand blargregister: foountil: foo.stdout.find("haystack") != -1delay: 15 # wait this many seconds before trying againtries: 5 # fail after this many tries
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)
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
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.wikipedia.org/wiki/Context-free_grammar
- 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
--
--
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.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.