README updated to mention blocks

This commit is contained in:
Emmanuel BENOîT 2022-09-02 20:29:40 +02:00
parent 5f719d7ab8
commit 9d7ea81783

View file

@ -42,6 +42,16 @@ The following actions are supported:
* `stop` stops processing the list of instructions for the current * `stop` stops processing the list of instructions for the current
host. host.
In addition, the `block` can be used to repeat multiple instructions or make
them obey a single conditional. The instruction must include a `block` field,
containing the list of instructions which are part of the block. It may have
a `rescue` field, containing a list of instructions which will be executed on
error, and `always`, which may contain a list of instructions to execute in
all cases. If the `locals` field is defined, it must contain a table of local
variables to define. Any local variable defined by the instructions under
`block`, `rescue` or `always` will go out of scope once the block finishes
executing.
A somewhat silly example can be found in the `example` directory. Trying to A somewhat silly example can be found in the `example` directory. Trying to
execute it using `ansible-inventory --graph` results in the following output. execute it using `ansible-inventory --graph` results in the following output.