expand "Dependencies" paragraph

This commit is contained in:
tpo 2014-04-30 15:57:44 +02:00
parent 5b8ab385f2
commit e5a12803ff

View file

@ -110,24 +110,39 @@ setup the variable "require" to contain the requirements. Multiple
requirements can be added white space separated. requirements can be added white space separated.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
# No dependency 1 # No dependency
__file /etc/cdist-configured 2 __file /etc/cdist-configured
3
# Require above object 4 # Require above object
require="__file/etc/cdist-configured" __link /tmp/cdist-testfile \ 5 require="__file/etc/cdist-configured" __link /tmp/cdist-testfile \
--source /etc/cdist-configured --type symbolic 6 --source /etc/cdist-configured --type symbolic
7
# Require two objects 8 # Require two objects
require="__file/etc/cdist-configured __link/tmp/cdist-testfile" \ 9 require="__file/etc/cdist-configured __link/tmp/cdist-testfile" \
__file /tmp/cdist-another-testfile 10 __file /tmp/cdist-another-testfile
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Above the "require" variable is only set for the command that is
immediately following it. Dependencies should allways be declared that way.
On line 4 you can see that the instantion of a type "__link" object needs
the object "__file/etc/cdist-configured" to be present, before it can proceed.
This also means that the "__link" command must make sure, that either
"__file/etc/cdist-configured" allready is present, or, if it's not, it needs
to be created. The task of cdist is to make sure, that the dependency will be
resolved appropriately and thus "__file/etc/cdist-configured" be created
if necessary before "__link" proceeds (or to abort execution with an error).
All objects that are created in a type manifest are automatically required All objects that are created in a type manifest are automatically required
from the type that is calling them. This is called "autorequirement" in from the type that is calling them. This is called "autorequirement" in
cdist jargon. cdist jargon.
You can find an more in depth description of the flow execution of manifests
in cdist-stages(7) and of how types work in cdist-type(7).
CREATE DEPENDENCIES FROM EXECUTION ORDER CREATE DEPENDENCIES FROM EXECUTION ORDER
----------------------------------------- -----------------------------------------
You can tell cdist to execute all types in the order in which they are created You can tell cdist to execute all types in the order in which they are created