documentation to __object in execution run

This commit is contained in:
Daniel Heule 2014-03-20 16:23:28 +01:00
commit b87b5eab31
2 changed files with 29 additions and 6 deletions

View file

@ -252,6 +252,27 @@ echo "touch /etc/cdist-configured"
--------------------------------------------------------------------------------
VARIABLE ACCESS FROM THE GENERATED SCRIPTS
------------------------------------------
In the generated scripts, you have access to the following cdist variables
- __object
- __object_id
but only for read operations, means there is no back copy of this
files after the script execution.
So when you generate a script with the following content, it will work:
--------------------------------------------------------------------------------
if [ -f "$__object/parameter/name" ]; then
name="$(cat "$__object/parameter/name")"
else
name="$__object_id"
fi
--------------------------------------------------------------------------------
HINTS FOR TYPEWRITERS
----------------------
It must be assumed that the target is pretty dumb and thus does not have high