Merge branch '__file_exists' of https://github.com/asteven/cdist

This commit is contained in:
Nico Schottelius 2012-04-04 09:32:08 +02:00
commit f2a51f1a10
2 changed files with 8 additions and 1 deletions

View file

@ -23,6 +23,9 @@
destination="/$__object_id" destination="/$__object_id"
state_should="$(cat "$__object/parameter/state")" state_should="$(cat "$__object/parameter/state")"
exists="$(cat "$__object/explorer/exists")"
[ "$state_should" = "exists" -a "$exists" = "yes" ] && exit 0 # nothing to do
if [ "$state_should" = "present" ]; then if [ "$state_should" = "present" ]; then
if [ -f "$__object/parameter/source" ]; then if [ -f "$__object/parameter/source" ]; then

View file

@ -21,7 +21,11 @@ None.
OPTIONAL PARAMETERS OPTIONAL PARAMETERS
------------------- -------------------
state:: state::
'present' or 'absent', defaults to 'present' 'present', 'absent' or 'exists', defaults to 'present'
where:
present: the file is exactly the one from source
absent: the file does not exist
exists: the file from source but only if it doesn't already exist
group:: group::
Group to chgrp to. Group to chgrp to.