Skip to content

Commit

Permalink
Document Condition command
Browse files Browse the repository at this point in the history
  • Loading branch information
tailhook committed Apr 3, 2018
1 parent 211b910 commit 388e387
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Contents:
info/index
running/index
scheduler/index
render/index
deploy-tutorial
changelog

Expand Down
38 changes: 38 additions & 0 deletions doc/render/commands.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Render Commands
===============


Condition
---------

Condition is a special command that executes other commands only if some
condition happens.

Example:

.. code-block: yaml
templates:
nginx: nginx.conf.trm
commands:
- !Copy
src: "{{ templates.nginx }}"
target: /etc/nginx/nginx.conf
- !Condition
dirs-changed: [/etc/nginx]
commands:
- !RootCommand [pkill, -HUP, nginx]
Conditions:

``dirs-changed``
Calculates hash of all files in the directory recursively at the beginning
of the **processing this .render.yaml** file. Then the hashsum is checked
again when ``!Condition`` is encountered and if hashsum changed
``commands`` are executed, otherwise they are silently skipped.

Options:

``commands``
List of commands to execute when condition is true. All the same commands
suported except the ``!Condition`` itself.
12 changes: 12 additions & 0 deletions doc/render/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Writing Renderers
=================

Renderer is a subsystem that executes all necessary steps to apply
verwalter schedule/configuration on each machine

Contents:

.. toctree::
:maxdepth: 2

commands

0 comments on commit 388e387

Please sign in to comment.