forked from ungleich-public/cdist
define stages
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
edc82f5423
commit
e43e910012
1 changed files with 48 additions and 48 deletions
|
@ -1,75 +1,75 @@
|
||||||
cdist-types(7)
|
cdist-stages(7)
|
||||||
===============
|
===============
|
||||||
Nico Schottelius <nico-cdist--@--schottelius.org>
|
Nico Schottelius <nico-cdist--@--schottelius.org>
|
||||||
|
|
||||||
|
|
||||||
NAME
|
NAME
|
||||||
----
|
----
|
||||||
cdist-types - Functionality bundled
|
cdist-stages - How the configuration is built
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
First stage: [done]
|
Starting the execution of deployment with cdist-deploy-to(1),
|
||||||
- If cdist encounters type in manifest,
|
cdist passes through different stages:
|
||||||
a wrapper script is run, that creates a
|
|
||||||
new entry in the cconfig database and adds
|
|
||||||
attribute values. This defines a cconfig
|
|
||||||
tree, that may look as follows:
|
|
||||||
|
|
||||||
<hostname>/<type>/<id>/<parameters>:
|
|
||||||
|
|
||||||
myhost/__file/cdist_bin/source
|
- First stage: Get information about target
|
||||||
myhost/__file/cdist_bin/destination
|
Every existing explorer (see cdist-explorers(7) is run on
|
||||||
...
|
the target and the results are copied back into the local
|
||||||
|
cache (see cdist-cache(7)). These values can be used by
|
||||||
|
manifests and types.
|
||||||
|
|
||||||
- In this stage, no conflicts may occur, as
|
- Second stage: Initial manifest run
|
||||||
no type code has been called (i.e. only
|
The initial manifest (see cdist-manifests(7) is run,
|
||||||
manifests, which map config to hosts is
|
which is done by cdist-manifest-init(1).
|
||||||
applied).
|
|
||||||
|
This run creates an internal database in cconfig
|
||||||
|
format (see cdist-config-layout(7), that contains all
|
||||||
|
objects configured for the specific host.
|
||||||
|
|
||||||
Second stage: [done]
|
In this stage, no conflicts may occur, i.e. no
|
||||||
- The "init" script of every used type
|
object of the same type with the same id may
|
||||||
(i.e. the manifests created at least one object)
|
be created.
|
||||||
is called, which again is able to call other
|
|
||||||
types. All created objects may also be modified
|
You can trigger the first stage part using
|
||||||
by the type.
|
cdist-manifest-init(1).
|
||||||
|
|
||||||
For instance a "httpd" type may call the
|
- Third stage: Execution of types
|
||||||
"webroot" type with --path / ...
|
Every object is checked whether its type has an init
|
||||||
# FIND CASE WHERE SENSEFUL => look through
|
script (see cdist-types(7)). If the type of the object
|
||||||
current puppet config
|
has an init script, it is run. This init script may
|
||||||
|
generate additional objects.
|
||||||
|
|
||||||
- The newly created objects are merged back into
|
For instance the object __apache/www.test.ch is of
|
||||||
the existing tree. No conflicts may occur during
|
type __apache, which may contain an init script, which
|
||||||
the merge, because this would implicit that the
|
creates new objects of type __file.
|
||||||
type conflicts with other types.
|
|
||||||
|
|
||||||
The idea of this that a type may expand another
|
The newly created objects are merged back into
|
||||||
type with functionality, but may need to adjust
|
the existing tree. No conflicts may occur during
|
||||||
("overwrite") settings from the original type.
|
the merge. A conflict would mean that two different
|
||||||
|
objects try to create the same object, which indicates a
|
||||||
|
broken configuration.
|
||||||
|
|
||||||
Third stage:
|
- Third stage: Code generation
|
||||||
- Cdist calls the "gencode" binary of the types
|
The "gencode" binary of the types for every existing object is
|
||||||
for every created object. This binary should create
|
called to generate code that will be executed on the target host.
|
||||||
code to be executed on the target on stdout.
|
|
||||||
|
|
||||||
If the gencode binary fails, it must print diagnostic
|
This binary should create code to be executed on the target on stdout.
|
||||||
messages on stderr and exit non-zero.
|
|
||||||
|
|
||||||
A description of what the generated code may/must/should
|
If the gencode binary fails, it must print diagnostic messages on stderr
|
||||||
do can be found at the end of this document.
|
and exit non-zero.
|
||||||
|
|
||||||
- Cdist merges together the generated code
|
A description of what the generated code may/must/should
|
||||||
(taking care of DEPENDENCIES (which are not
|
do can be found in cdist-types-gencode(7).
|
||||||
yet defined (take care, double nested brackets)))
|
|
||||||
|
- Fourth stage:
|
||||||
|
The resulting code is transferred to the target host and executed,
|
||||||
|
the run of cdist-deploy-to(1) ends.
|
||||||
|
|
||||||
Fourth stage:
|
|
||||||
- The resulting shell script is transferred
|
|
||||||
to the target and executed.
|
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
--------
|
--------
|
||||||
|
cdist(7), cdist-deploy-to(1), cdist-config-layout(7), cdist-manifest-init(1)
|
||||||
|
|
||||||
|
|
||||||
COPYING
|
COPYING
|
||||||
|
|
Loading…
Reference in a new issue