From a23c9936b6fabf2489ce54fae666110747f61641 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Sat, 2 May 2015 12:29:34 +0200 Subject: [PATCH] Fix #32: Extend image_commands docs --- bootstrapvz/plugins/image_commands/README.rst | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/bootstrapvz/plugins/image_commands/README.rst b/bootstrapvz/plugins/image_commands/README.rst index 5ed7e65..fd4e579 100644 --- a/bootstrapvz/plugins/image_commands/README.rst +++ b/bootstrapvz/plugins/image_commands/README.rst @@ -11,9 +11,22 @@ Settings - ``commands``: A list of lists containing strings. Each top-level item is a single command, while the strings inside each list comprise - parts of a command. This allows for proper shell argument escaping - (to circumvent this, simply put the entire command in a single - string). In addition to the manifest variables ``{root}`` is also - available. It points at the root of the image volume. + parts of a command. This allows for proper shell argument escaping. + To circumvent escaping, simply put the entire command in a single + string, the command will additionally be evaluated in a shell + (e.g. globbing will work). + In addition to the manifest variables ``{root}`` is also available. + It points at the root of the image volume. ``required`` ``manifest vars`` + +Example +~~~~~~~ + +Create an empty `index.html` in `/var/www` and delete all locales except english. +.. code:: yaml + + image_commands: + commands: + - [touch, '{root}/var/www/index.html'] + - ['rm -rf /usr/share/locale/[^en]*']