Merge branch 'master' into 4.0-pre-not-stable

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>

Conflicts:
	cdist/config.py
	cdist/emulator.py
	docs/changelog
This commit is contained in:
Nico Schottelius 2014-02-05 23:22:04 +01:00
commit 5389d71905
36 changed files with 641 additions and 28 deletions

View file

@ -8,8 +8,29 @@ Changelog
* Core: Integrate initial install support
* Core: Integrate initial preos support
3.0.4:
3.0.6:
* New Type: __apt_key (Steven Armstrong)
* New Type: __apt_key_uri (Steven Armstrong)
* New Type: __apt_norecommends (Steven Armstrong)
* New Type: __apt_source (Steven Armstrong)
3.0.5: 2014-02-05
* Core: Introduce override concept (Daniel Heule)
* Type __process: Make --state absent work (Steven Armstrong)
* Documentation: Update documentation for environment variables
3.0.4: 2014-01-29
* Core: Ignore install types in config mode
* Documentation: Update reference (files path in object space)
* Documentation: Update best practise: Replaces templates/ with files/
>>>>>>> master
* Type __apt_ppa: Install required software (Steven Armstrong)
* Type __debconf_set_selections: Support --file - to read from stdin
* Type __jail: Fix jaildir parameter handling (Jake Guffey)
3.0.3: 2014-01-22
* Core: Enhance error message when requirement is missing object id
@ -23,6 +44,7 @@ Changelog
* Type __zypper_repo: Use default paremeters (Daniel Heule)
* Type __zypper_service: Use default paremeters (Daniel Heule)
3.0.2: 2014-01-19
* Documentation: Document all messages sent by types (Daniel Heule)
* New Type: __block (Steven Armstrong)

View file

@ -131,7 +131,8 @@ confdir/type/<name>/explorer::
confdir/type/<name>/files::
This directory is reserved for user data and will not be used
by cdist at any time
by cdist at any time. It can be used for storing supplementary
files (like scripts to act as a template or configuration files).
out/::
This directory contains output of cdist and is usually located
@ -175,13 +176,22 @@ OBJECTS
For object to object communication and tests, the following paths are
usable within a object directory:
files::
This directory is reserved for user data and will not be used
by cdist at any time. It can be used freely by the type
(for instance to store template results).
changed::
This empty file exists in an object directory, if the object has
code to be excuted (either remote or local)
stdin::
This file exists and contains data, if data was provided on stdin
when the type was called.
ENVIRONMENT VARIABLES
---------------------
ENVIRONMENT VARIABLES (FOR READING)
-----------------------------------
The following environment variables are exported by cdist:
__explorer::
Directory that contains all global explorers.
Available for: initial manifest, explorer, type explorer, shell
@ -219,6 +229,15 @@ __type_explorer::
Directory that contains the type explorers.
Available for: type explorer
ENVIRONMENT VARIABLES (FOR WRITING)
-----------------------------------
The following environment variables influence the behaviour of cdist:
require::
Setup dependencies between objects (see cdist-manifest(7))
CDIST_ALLOW_OVERRIDE::
Allow overwriting type parameters (see cdist-manifest(7))
SEE ALSO
--------

View file

@ -164,8 +164,8 @@ For more details consult sudoers(5)
TEMPLATING
----------
* create directory templates/ in your type (convention)
* create the template as an executable file like templates/basic.conf.sh, it will output text using shell variables for the values
* create directory files/ in your type (convention)
* create the template as an executable file like files/basic.conf.sh, it will output text using shell variables for the values
--------------------------------------------------------------------------------
#!/bin/sh
@ -191,7 +191,7 @@ EOF
export ROOT='/var/www/test'
# render the template
mkdir -p "$__object/files"
"$__type/templates/basic.conf.sh" > "$__object/files/basic.conf"
"$__type/files/basic.conf.sh" > "$__object/files/basic.conf"
# send the rendered template
__file /etc/nginx/sites-available/test.conf \
--state present

View file

@ -129,6 +129,19 @@ from the type that is calling them. This is called "autorequirement" in
cdist jargon.
OVERRIDES
---------
In some special cases, you would like to create an already defined object
with different parameters. In normal situations this leads to an error in cdist.
If you whish, you can setup the environment variable CDIST_ALLOW_OVERRIDE
(any value or even empty is ok) to tell cdist, that this object override is
wanted and should be accepted.
ATTENTION: Only use this feature if you are 100% sure in which order
cdist encounter the affected objects, otherwhise this results
into an undefined situation.
THIS IS A BETA FEATURE AND MAY BE REMOVED AT ANY TIME.
EXAMPLES
--------
The initial manifest may for instance contain the following code:
@ -161,6 +174,26 @@ __package lighttpd --state present
require="__package/lighttpd" __package munin --state present
--------------------------------------------------------------------------------
How to override objects:
--------------------------------------------------------------------------------
# for example in the inital manifest
# reate user account foobar with some hash for password
__user foobar --password 'some_fancy_hash' --home /home/foobarexample
# ... many statements and includes in the manifest later ...
# somewhere in a conditionaly sourced manifest
# (e.g. for example only sourced if a special application is on the target host)
# this leads to an error ...
__user foobar --password 'some_other_hash'
# this tells cdist, that you know that this is an override and should be accepted
CDIST_ALLOW_OVERRIDE=yes __user foobar --password 'some_other_hash'
# its only an override, means the parameter --home is not touched
# and stay at the original value of /home/foobarexample
--------------------------------------------------------------------------------
SEE ALSO