2016-06-17 19:28:16 +00:00
|
|
|
Execution stages
|
|
|
|
================
|
2016-06-23 14:08:59 +00:00
|
|
|
|
2016-06-17 19:28:16 +00:00
|
|
|
Description
|
2011-02-07 21:46:47 +00:00
|
|
|
-----------
|
2012-01-17 22:53:58 +00:00
|
|
|
Starting the execution of deployment with cdist, cdist passes
|
|
|
|
through different stages.
|
2011-03-07 22:06:15 +00:00
|
|
|
|
|
|
|
|
2016-06-17 19:28:16 +00:00
|
|
|
Stage 1: target information retrieval
|
2011-03-29 21:57:37 +00:00
|
|
|
-------------------------------------
|
2011-03-07 22:06:15 +00:00
|
|
|
In this stage information is collected about the target host using so called
|
|
|
|
explorers. Every existing explorer is run on the target and the output of all
|
|
|
|
explorers are copied back into the local cache. The results can be used by
|
|
|
|
manifests and types.
|
2011-02-19 01:00:32 +00:00
|
|
|
|
|
|
|
|
2016-06-17 19:28:16 +00:00
|
|
|
Stage 2: run the initial manifest
|
2011-02-19 01:00:32 +00:00
|
|
|
---------------------------------
|
2011-02-19 11:48:26 +00:00
|
|
|
The initial manifest, which should be used for mappings of hosts to types,
|
|
|
|
is executed. This stage creates objects in a cconfig database that contains
|
|
|
|
the objects as defined in the manifest for the specific host. In this stage,
|
|
|
|
no conflicts may occur, i.e. no object of the same type with the same id may
|
2012-03-09 22:14:06 +00:00
|
|
|
be created, if it has different parameters.
|
2011-02-19 01:00:32 +00:00
|
|
|
|
2011-02-19 11:48:26 +00:00
|
|
|
|
2016-06-17 19:28:16 +00:00
|
|
|
Stage 3: object information retrieval
|
2011-03-29 14:11:38 +00:00
|
|
|
-------------------------------------
|
|
|
|
Every object is checked whether its type has explorers and if so, these are
|
2013-06-03 16:11:19 +00:00
|
|
|
executed on the target host. The results are transferred back
|
2011-04-05 20:46:51 +00:00
|
|
|
and can be used in the following stages to decide what changes need to be made
|
2011-03-29 14:11:38 +00:00
|
|
|
on the target to implement the desired state.
|
|
|
|
|
|
|
|
|
2016-06-17 19:28:16 +00:00
|
|
|
Stage 4: run the object manifest
|
2011-03-29 14:11:38 +00:00
|
|
|
--------------------------------
|
2011-04-05 20:46:51 +00:00
|
|
|
Every object is checked whether its type has a executable manifest. The
|
|
|
|
manifest script may generate and change the created objects. In other words,
|
|
|
|
one type can reuse other types.
|
2011-02-19 11:48:26 +00:00
|
|
|
|
2012-03-09 22:14:06 +00:00
|
|
|
For instance the object __apache/www.example.org is of type __apache, which may
|
2011-03-07 22:06:15 +00:00
|
|
|
contain a manifest script, which creates new objects of type __file.
|
2011-02-07 22:07:43 +00:00
|
|
|
|
2011-02-19 11:48:26 +00:00
|
|
|
The newly created objects are merged back into the existing tree. No conflicts
|
|
|
|
may occur during the merge. A conflict would mean that two different objects
|
|
|
|
try to create the same object, which indicates a broken configuration.
|
|
|
|
|
2011-02-07 22:07:43 +00:00
|
|
|
|
2016-06-17 19:28:16 +00:00
|
|
|
Stage 5: code generation
|
2011-02-19 01:00:32 +00:00
|
|
|
------------------------
|
2011-04-05 20:50:38 +00:00
|
|
|
In this stage for every created object its type is checked for executable
|
|
|
|
gencode scripts. The gencode scripts generate the code to be executed on the
|
|
|
|
target on stdout. If the gencode executables fail, they must print diagnostic
|
|
|
|
messages on stderr and exit non-zero.
|
2011-02-07 22:07:43 +00:00
|
|
|
|
|
|
|
|
2016-06-17 19:28:16 +00:00
|
|
|
Stage 6: code execution
|
2011-02-19 01:00:32 +00:00
|
|
|
-----------------------
|
2011-03-29 14:11:38 +00:00
|
|
|
For every object the resulting code from the previous stage is transferred to
|
|
|
|
the target host and executed there to apply the configuration changes.
|
|
|
|
|
|
|
|
|
2016-06-17 19:28:16 +00:00
|
|
|
Stage 7: cache
|
2011-03-29 14:11:38 +00:00
|
|
|
--------------
|
|
|
|
The cache stores the information from the current run for later use.
|
2011-02-19 11:48:26 +00:00
|
|
|
|
|
|
|
|
2016-06-17 19:28:16 +00:00
|
|
|
Summary
|
2011-02-19 11:48:26 +00:00
|
|
|
-------
|
|
|
|
If, and only if, all the stages complete without an errors, the configuration
|
2012-01-17 22:53:58 +00:00
|
|
|
will be applied to the target.
|