forked from ungleich-public/cdist
move manifest stuff into manifest file from tutorial
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
parent
c5cd1ce89a
commit
ae8f2b35ca
2 changed files with 62 additions and 42 deletions
|
@ -8,6 +8,46 @@ NAME
|
||||||
cdist-manifest - Define types to be used
|
cdist-manifest - Define types to be used
|
||||||
|
|
||||||
|
|
||||||
|
DEFINE STATE IN THE INITIAL MANIFEST
|
||||||
|
------------------------------------
|
||||||
|
The **initial manifest** is the entry point for cdist to find out, which
|
||||||
|
**objects** to configure on the selected host. Objects are instances of
|
||||||
|
**types**, like in object orientated programming languages.
|
||||||
|
An object is represented by the
|
||||||
|
type + slash + object name: ***__file/etc/cdist-configured*** is an
|
||||||
|
object of the type ***__file*** with the name ***etc/cdist-configured***.
|
||||||
|
|
||||||
|
Cdist searches for the initial manifest at **conf/manifest/init** and
|
||||||
|
executes it as a shell script using **/bin/sh -e**.
|
||||||
|
|
||||||
|
Within this initial manifest, you define, which objects should be
|
||||||
|
created on which host. To distinguish between hosts, you can use the
|
||||||
|
environment variable **__target_host**. Let's have a look at a simple
|
||||||
|
example:
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
__cdistmarker
|
||||||
|
|
||||||
|
case "$__target_host" in
|
||||||
|
localhost)
|
||||||
|
__directory /home/services/kvm-vm --parents yes
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
This manifest says: Independent of the host, always use the type
|
||||||
|
***__cdistmarker***, which creates the file **/etc/cdist-configured**,
|
||||||
|
with the timestamp as content.
|
||||||
|
The directory ***/home/services/kvm-vm***, including all parent directories,
|
||||||
|
is only created on the host ***localhost***.
|
||||||
|
|
||||||
|
As you can see, there is no magic involved, the manifest is simple shell code that
|
||||||
|
utilises cdist types. Every available type can be executed like a normal
|
||||||
|
command. Use **ls conf/type** to get a list of available types. If you have
|
||||||
|
setup the MANPATH correctly as, you can use **man cdist-reference** to access
|
||||||
|
the reference with pointers to the manpages.
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
Manifests exist to define which configurations should be applied to a specific
|
Manifests exist to define which configurations should be applied to a specific
|
||||||
|
@ -69,12 +109,10 @@ require="__file/etc/cdist-configured __link/tmp/cdist-testfile" \
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
--------
|
--------
|
||||||
- cdist-manifest-run(1)
|
|
||||||
- cdist-manifest-run-init(1)
|
|
||||||
- cdist-type(7)
|
- cdist-type(7)
|
||||||
|
|
||||||
|
|
||||||
COPYING
|
COPYING
|
||||||
-------
|
-------
|
||||||
Copyright \(C) 2010-2011 Nico Schottelius. Free use of this software is
|
Copyright \(C) 2010-2012 Nico Schottelius. Free use of this software is
|
||||||
granted under the terms of the GNU General Public License version 3 (GPLv3).
|
granted under the terms of the GNU General Public License version 3 (GPLv3).
|
||||||
|
|
|
@ -13,49 +13,31 @@ INTRODUCTION
|
||||||
This document gives you a pointer on what to read in
|
This document gives you a pointer on what to read in
|
||||||
which order and is thus more a "guide to the right locations".
|
which order and is thus more a "guide to the right locations".
|
||||||
|
|
||||||
|
cdist-quickstart::
|
||||||
|
Read this, if you are brand new in the cdist world and just want
|
||||||
|
to get your hands dirty.
|
||||||
|
|
||||||
|
cdist-reference::
|
||||||
DEFINE STATE IN THE INITIAL MANIFEST
|
Know everything about cdist: the types, explorers or environment
|
||||||
------------------------------------
|
variables usable.
|
||||||
The **initial manifest** is the entry point for cdist to find out, which
|
|
||||||
**objects** to configure on the selected host. Objects are instances of
|
|
||||||
**types**, like in object orientated programming languages.
|
|
||||||
An object is represented by the
|
|
||||||
type + slash + object name: ***__file/etc/cdist-configured*** is an
|
|
||||||
object of the type ***__file*** with the name ***etc/cdist-configured***.
|
|
||||||
|
|
||||||
Cdist searches for the initial manifest at **conf/manifest/init** and
|
|
||||||
executes it as a shell script using **/bin/sh -e**.
|
|
||||||
|
|
||||||
Within this initial manifest, you define, which objects should be
|
|
||||||
created on which host. To distinguish between hosts, you can use the
|
|
||||||
environment variable **__target_host**. Let's have a look at a simple
|
|
||||||
example:
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
__cdistmarker
|
|
||||||
|
|
||||||
case "$__target_host" in
|
|
||||||
localhost)
|
|
||||||
__directory /home/services/kvm-vm --parents yes
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
This manifest says: Independent of the host, always use the type
|
|
||||||
***__cdistmarker***, which creates the file **/etc/cdist-configured**,
|
|
||||||
with the timestamp as content.
|
|
||||||
The directory ***/home/services/kvm-vm***, including all parent directories,
|
|
||||||
is only created on the host ***localhost***.
|
|
||||||
|
|
||||||
As you can see, there is no magic involved, the manifest is simple shell code that
|
|
||||||
utilises cdist types. Every available type can be executed like a normal
|
|
||||||
command. Use **ls conf/type** to get a list of available types. If you have
|
|
||||||
setup the MANPATH correctly as, you can use **man cdist-reference** to access
|
|
||||||
the reference with pointers to the manpages.
|
|
||||||
|
|
||||||
PARTS BELOW HERE ARE TO-BE-DONE
|
PARTS BELOW HERE ARE TO-BE-DONE
|
||||||
|
|
||||||
|
cdist-installation::
|
||||||
|
The comprehensive guide to your first cdist installation.
|
||||||
|
|
||||||
|
cdist-manifest::
|
||||||
|
initial in here
|
||||||
|
|
||||||
|
cdist-best-practice::
|
||||||
|
cdist-explorer::
|
||||||
|
cdist-hacker::
|
||||||
|
|
||||||
|
cdist-stages::
|
||||||
|
cdist-type::
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-> ssh stuff double: cdist-best-practice and here
|
-> ssh stuff double: cdist-best-practice and here
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue