diff --git a/cdist/conf/type/__git/manifest b/cdist/conf/type/__git/manifest index 866515d7..e8c9b233 100644 --- a/cdist/conf/type/__git/manifest +++ b/cdist/conf/type/__git/manifest @@ -26,7 +26,22 @@ __package git --state present state_should=present [ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")" +[ -f "$__object/parameter/owner" ] && dirparams="$dirparams --owner $(cat "$__object/parameter/owner")" +[ -f "$__object/parameter/group" ] && dirparams="$dirparams --group $(cat "$__object/parameter/group")" + # Let __directory handle removal of git repos -if [ "$state_should" = absent ]; then - __directory "$__object_id" --state absent -fi + +case "$state_should" in + present) + __directory "$__object_id" --state present $dirparams --recursive + ;; + + absent) + __directory "$__object_id" --state absent + ;; + + *) + echo "Unknown state: $state_should" >&2 + exit 1 + ;; +esac diff --git a/cdist/conf/type/__git/parameter/optional b/cdist/conf/type/__git/parameter/optional index 671134d6..d9684aaa 100644 --- a/cdist/conf/type/__git/parameter/optional +++ b/cdist/conf/type/__git/parameter/optional @@ -1,2 +1,4 @@ state branch +group +owner