{% extends "base.html" %} {% load core_extras %} {% load crispy_forms_tags %} {% load staticfiles %} {% block page_scripts %} {% endblock %} {% block content %}

{% model_icon 'task' %} {% if is_new %}Add task{% else %}Task {{ task.name }}{% endif %}

{% if task %}

Execute

{% endif %}
{% csrf_token %} {% crispy form form.helper %}

 

{{ form_parameters.non_field_errors }} {{ form_parameters.management_form }} {% for form in form_parameters %} {% if not form.DELETE.value %}
{% include 'partial/form/formset_form_managment.html' %} {% include 'partial/form/text.html' with field=form.name class='col-sm-offset-1 col-xs-12 col-sm-3 col-md-3' %} {% include 'partial/form/text.html' with field=form.description class='col-xs-12 col-sm-6 col-md-6' %} {% include 'partial/form/formset_actions.html' %}
{% endif %} {% endfor %}

 

{{ form_commands.non_field_errors }}

Commands are executed in non-login, non-interactive shell. It's allowed to use stream redirection and pipes in commands. Examples:

  • timestamped backup: tar -cpzf /home/backup/backup-${gun_time}.tar.gz /var/www/
  • clear memcached: ( sleep 3 ; echo 'flush_all' ; sleep 2 ; echo q; echo q; ) | telnet 127.0.0.1 11211 -eq
  • make: cd /var/www/your_project; make all

To use custom parameters in commands include ${parameter_name}.

Available global parameters:
    {% for name, value in global_parameters %}
  • ${% templatetag openbrace %}{{ name }}{% templatetag closebrace %} {{ value }}
  • {% endfor %}
{{ form_commands.management_form }} {% if form_commands.non_form_errors %}
    {% for error in form_commands.non_form_errors %}
  • {{ error }}
  • {% endfor %}
{% endif %} {% for form in form_commands %} {% if not form.DELETE.value %}
{% include 'partial/form/formset_form_managment.html' %} {% include 'partial/form/text.html' with field=form.command class='col-sm-offset-1 col-sm-7' %} {% include 'partial/form/formset_actions.html' %}
{{ form.roles }} {% if form.roles.errors %}

{{ form.roles.errors|first }}

{% endif %}
{% endif %} {% endfor %}
{% if not is_new %}
{% csrf_token %}
{% endif %} {% endblock %}